Skip to content

Commit 65396bc

Browse files
gcc-5490
Imported from gcc-5490.tar.gz
1 parent a93872b commit 65396bc

File tree

14 files changed

+220
-34
lines changed

14 files changed

+220
-34
lines changed

gcc/ChangeLog.apple

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,49 @@
1+
2008-09-22 Stuart Hastings <[email protected]>
2+
3+
Radar 6185789
4+
* gcc/cp/decl.c (cp_finish_decl): Backport 4.2 code to clear
5+
readonly bit on runtime-initialized variables.
6+
7+
2008-09-17 Josh Conner <[email protected]>
8+
9+
Radar 6204451
10+
* global.c (global_alloc): Remove code that ignores conflicts
11+
on single-set tied pseudos.
12+
13+
2008-08-19 Josh Conner <[email protected]>
14+
15+
Radar 6061427
16+
* Change section type for objc_v2_selector_refs_section
17+
to literal_pointers.
18+
19+
2008-08-19 Josh Conner <[email protected]>
20+
21+
Radar 6158246
22+
23+
Revert:
24+
2008-08-18 Josh Conner <[email protected]>
25+
* config/rs6000/t-darwin (MULTILIB_EXTRA_OPTS): Define.
26+
27+
Add:
28+
* config/rs6000/t-darwin10: New file.
29+
30+
2008-08-18 Josh Conner <[email protected]>
31+
32+
Radar 6158246
33+
* config/rs6000/t-darwin (MULTILIB_EXTRA_OPTS): Define.
34+
35+
2008-08-18 Josh Conner <[email protected]>
36+
37+
Radar 6132019
38+
* config/rs6000/rs6000.c (machopic_output_stub): Fix alloca
39+
size.
40+
41+
2008-07-22 Josh Conner <[email protected]>
42+
43+
Radar 6034515
44+
* config/darwin.c (machopic_symbol_defined_p): Return false
45+
for a weak function declaration.
46+
147
2008-07-15 Josh Conner <[email protected]>
248

349
Radar 6067743

gcc/config/darwin.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,15 @@ machopic_symbol_defined_p (rtx sym_ref)
140140
if (DECL_COMMON (decl))
141141
return false;
142142
}
143+
/* APPLE LOCAL begin 6077274 */
144+
/* Weak functions should always be indirected. */
145+
else if (SYMBOL_REF_FLAGS (sym_ref) & SYMBOL_FLAG_FUNCTION)
146+
{
147+
tree decl = SYMBOL_REF_DECL (sym_ref);
148+
if (decl && DECL_WEAK (decl))
149+
return false;
150+
}
151+
/* APPLE LOCAL end 6077274 */
143152
return true;
144153
}
145154
return false;

gcc/config/darwin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1301,7 +1301,7 @@ SECTION_FUNCTION (objc_v2_nonlazy_category_section, \
13011301
".section __DATA, __objc_nlcatlist, regular, no_dead_strip", 1) \
13021302
SECTION_FUNCTION (objc_v2_selector_refs_section, \
13031303
in_objc_v2_selector_refs_section, \
1304-
".section __DATA, __objc_selrefs, regular, no_dead_strip", 1) \
1304+
".section __DATA, __objc_selrefs, literal_pointers, no_dead_strip", 1) \
13051305
SECTION_FUNCTION (objc_v2_image_info_section, \
13061306
in_objc_v2_image_info_section, \
13071307
".section __DATA, __objc_imageinfo, regular, " \

gcc/config/rs6000/rs6000.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20310,7 +20310,7 @@ machopic_output_stub (FILE *file, const char *symb, const char *stub)
2031020310
fprintf (file, "\t.indirect_symbol %s\n", symbol_name);
2031120311

2031220312
label++;
20313-
local_label_0 = alloca (sizeof("\"L0000000000$spb\""));
20313+
local_label_0 = alloca (sizeof("\"L00000000000$spb\""));
2031420314
sprintf (local_label_0, "\"L%011d$spb\"", label);
2031520315

2031620316
fprintf (file, "\tmflr r0\n");

gcc/config/rs6000/t-darwin10

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# APPLE LOCAL file 5901604
2+
MULTILIB_EXTRA_OPTS = isysroot/Developer/SDKs/MacOSX10.5.sdk

gcc/cp/decl.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5128,7 +5128,20 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags)
51285128
initializer. It is not legal to redeclare a static data
51295129
member, so this issue does not arise in that case. */
51305130
if (var_definition_p && TREE_STATIC (decl))
5131-
expand_static_init (decl, init);
5131+
/* APPLE LOCAL begin 4.2 backport 6185789 */
5132+
{
5133+
/* If a TREE_READONLY variable needs initialization
5134+
at runtime, it is no longer readonly and we need to
5135+
avoid MEM_READONLY_P being set on RTL created for it. */
5136+
if (init)
5137+
{
5138+
if (TREE_READONLY (decl))
5139+
TREE_READONLY (decl) = 0;
5140+
was_readonly = 0;
5141+
}
5142+
expand_static_init (decl, init);
5143+
}
5144+
/* APPLE LOCAL end 4.2 backport 6185789 */
51325145
}
51335146
}
51345147

gcc/global.c

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -680,33 +680,6 @@ global_alloc (FILE *file)
680680

681681
mirror_conflicts ();
682682

683-
/* APPLE LOCAL begin 4321079 */
684-
/* If two regs are tied by pseudo_preferences, and each is assigned to
685-
only once, they can share the same register even if their lifetimes
686-
overlap, as one must be a copy of the other. */
687-
{
688-
int i, j;
689-
for (i = max_allocno - 1; i >= 0; i--)
690-
{
691-
EXECUTE_IF_SET_IN_ALLOCNO_SET (pseudo_preferences
692-
+ i * allocno_row_words,
693-
j,
694-
{
695-
if (REG_N_SETS (allocno[i].reg) == 1
696-
&& REG_N_SETS (allocno[j].reg) == 1)
697-
{
698-
conflicts[(i) * allocno_row_words
699-
+ (unsigned) (j) / INT_BITS]
700-
&= ~((INT_TYPE) 1 << ((unsigned) (j) % INT_BITS));
701-
conflicts[(j) * allocno_row_words
702-
+ (unsigned) (i) / INT_BITS]
703-
&= ~((INT_TYPE) 1 << ((unsigned) (i) % INT_BITS));
704-
}
705-
});
706-
}
707-
}
708-
/* APPLE LOCAL end 4321079 */
709-
710683
/* Eliminate conflicts between pseudos and eliminable registers. If
711684
the register is not eliminated, the pseudo won't really be able to
712685
live in the eliminable register, so the conflict doesn't matter.

gcc/testsuite/ChangeLog.apple

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
2008-09-22 Stuart Hastings <[email protected]>
2+
3+
Radar 6185789
4+
* g++.apple/6185789.C: New.
5+
6+
2008-09-22 Josh Conner <[email protected]>
7+
8+
Radar 6204451
9+
* objc.dg/6204451.m: New test.
10+
11+
2008-08-04 Jon Ziegler <[email protected]>
12+
13+
Radar 6112293
14+
* gcc.c-torture/execute/builtins/lib/sprintf.c
15+
* gcc.dg/cpp/trad/include.c
16+
17+
2008-07-22 Josh Conner <[email protected]>
18+
19+
Radar 6034515
20+
* g++.apple/rtti-1.C: New test.
21+
122
2008-05-15 Josh Conner <[email protected]>
223

324
Radar 5920116

gcc/testsuite/g++.apple/6185789.C

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/* APPLE LOCAL file 6185789 */
2+
/* { dg-do run } */
3+
/* { dg-options { "-O2" } } */
4+
#include <stdio.h>
5+
#include <stdint.h>
6+
#include <stdlib.h>
7+
extern "C" {
8+
#pragma pack(push, 4)
9+
typedef int64_t FigTimeValue;
10+
typedef int32_t FigTimeScale;
11+
typedef int64_t FigTimeEpoch;
12+
enum {
13+
kFigTimeFlags_Valid = 1UL<<0,
14+
kFigTimeFlags_HasBeenRounded = 1UL<<1,
15+
kFigTimeFlags_PositiveInfinity = 1UL<<2,
16+
kFigTimeFlags_NegativeInfinity = 1UL<<3,
17+
kFigTimeFlags_Indefinite = 1UL<<4,
18+
kFigTimeFlags_ImpliedValueFlagsMask = kFigTimeFlags_PositiveInfinity | kFigTimeFlags_NegativeInfinity | kFigTimeFlags_Indefinite
19+
};
20+
typedef uint32_t FigTimeFlags;
21+
typedef struct
22+
{
23+
FigTimeValue value;
24+
FigTimeScale timescale;
25+
FigTimeEpoch epoch;
26+
FigTimeFlags flags;
27+
} FigTime;
28+
#pragma pack(pop)
29+
}
30+
FigTime
31+
FigTimeMake(int64_t value, int32_t timescale)
32+
{
33+
FigTime tm = {value, timescale, 0, kFigTimeFlags_Valid};
34+
return tm;
35+
}
36+
const FigTime FOO = FigTimeMake(3, 1);
37+
int main()
38+
{
39+
FigTime t1 = FOO;
40+
if (t1.value != FOO.value)
41+
abort ();
42+
else
43+
return 0;
44+
}

gcc/testsuite/g++.apple/rtti-1.C

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/* APPLE LOCAL file ARM 6034515 */
2+
/* { dg-do run { target arm*-*-darwin* } } */
3+
/* { dg-options "-fvisibility-inlines-hidden -mthumb" } */
4+
#include <typeinfo>
5+
6+
int main (void)
7+
{
8+
typeid(int).name();
9+
return 0;
10+
}

gcc/testsuite/gcc.c-torture/execute/builtins/lib/sprintf.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
extern int inside_main;
44

55
int
6-
sprintf (char *buf, const char *fmt, ...)
6+
/* APPLE LOCAL radar 6112293 */
7+
(sprintf) (char *buf, const char *fmt, ...)
78
{
89
va_list ap;
910
int r;

gcc/testsuite/gcc.dg/cpp/trad/include.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@
55
/* { dg-do preprocess } */
66

77
#define __STDC__ 1 /* Stop complaints about non-ISO compilers. */
8-
#define stdio 1
9-
#include <stdio.h> /* { dg-bogus "o such file or directory" } */
8+
/* APPLE LOCAL begin Radar 6112293 */
9+
#define errno 1
10+
#include <errno.h> /* { dg-bogus "o such file or directory" } */
11+
/* APPLE LOCAL end Radar 6112293 */

gcc/testsuite/objc.dg/6204451.m

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
/* APPLE LOCAL 6204451 */
2+
/* { dg-options "-O1 -framework Foundation" } */
3+
/* { dg-do run } */
4+
5+
#import <Foundation/NSObject.h>
6+
#include <stdlib.h>
7+
8+
@interface SimpleObject : NSObject {
9+
}
10+
11+
@end
12+
13+
int globalCount = 0;
14+
15+
@implementation SimpleObject
16+
17+
typedef struct _Node
18+
{
19+
struct _Node *nextNode;
20+
} Node;
21+
22+
- (void)testMethod
23+
{
24+
;
25+
}
26+
27+
- (void)doLinkedListTest
28+
{
29+
Node *rootNode, *newNode, *prevNode, *node;
30+
int i;
31+
32+
// construct the linked list
33+
rootNode = nil;
34+
for (i = 0; i < 5; i++)
35+
{
36+
newNode = (Node *)malloc(sizeof(Node));
37+
newNode->nextNode = nil;
38+
if (rootNode == nil)
39+
rootNode = newNode;
40+
else
41+
prevNode->nextNode = newNode;
42+
prevNode = newNode;
43+
[self testMethod];
44+
}
45+
46+
// verify the linked list
47+
node = rootNode;
48+
while (node != nil)
49+
{
50+
globalCount++;
51+
node = node->nextNode;
52+
}
53+
}
54+
55+
@end
56+
57+
int main (void)
58+
{
59+
SimpleObject *myObject = [SimpleObject alloc];
60+
[myObject doLinkedListTest];
61+
if (globalCount != 5)
62+
abort();
63+
return 0;
64+
}
65+

gcc/version.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
to get version number string. Do not use new line.
1717
*/
1818

19-
const char version_string[] = "4.0.1 (Apple Inc. build 5488)";
19+
const char version_string[] = "4.0.1 (Apple Inc. build 5490)";
2020
/* APPLE LOCAL end Apple version */
2121

2222
/* This is the location of the online document giving instructions for

0 commit comments

Comments
 (0)