Skip to content

Commit e19d86d

Browse files
gcc-5664
Imported from gcc-5664.tar.gz
1 parent fd0174a commit e19d86d

32 files changed

+648
-196
lines changed

ChangeLog.apple

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2010-02-08 Jim Grosbach <[email protected]>
2+
3+
Radar 7148788
4+
* driverdriver.c (get_arch_name): Issue diagnostic for ARM archs not
5+
explicitly recognized.
6+
17
2009-05-27 Bob Wilson <[email protected]>
28

39
Radar 6915254

config/mh-x86-darwin

+4
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@
33
# position-independent-code -- the usual default on Darwin.
44

55
BOOT_CFLAGS=-g -O2 -mdynamic-no-pic
6+
7+
# For hosts after darwin10 we want to pass in -no-pie
8+
BOOT_LDFLAGS=`case ${host} in *-*-darwin[1][1-9]*) echo -Wl,-no_pie ;; esac;`
9+
LDFLAGS=$(BOOT_LDFLAGS)

configure

+141-138
Large diffs are not rendered by default.

configure.in

+3
Original file line numberDiff line numberDiff line change
@@ -966,6 +966,9 @@ case "${host}" in
966966
host_makefile_frag="config/mh-ppc-darwin"
967967
;;
968968
# APPLE LOCAL begin dynamic-no-pic
969+
x86_64-*-darwin*)
970+
host_makefile_frag="config/mh-x86-darwin"
971+
;;
969972
i[[3456789]]86-*-darwin*)
970973
host_makefile_frag="config/mh-x86-darwin"
971974
# gcc can default to x86_64 code generation, avoid that

driverdriver.c

+6
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ struct arch_config_guess_map arch_config_map [] =
123123
{"ppc", "powerpc"},
124124
{"ppc64", "powerpc"},
125125
{"x86_64", "i686"},
126+
/* Note: It's required that all supported ARM architectures be listed
127+
* here explicitly */
126128
{"arm", "arm"},
127129
{"armv4t", "arm"},
128130
{"armv5", "arm"},
@@ -210,6 +212,10 @@ get_arch_name (const char *name)
210212
else map++;
211213
}
212214
a_info = (NXArchInfo *) NXGetArchInfoFromName (name);
215+
/* radr://7148788 emit diagnostic for ARM architectures not explicitly
216+
* handled by the driver. */
217+
if (a_info && a_info->cputype == CPU_TYPE_ARM)
218+
a_info = NULL;
213219
} else {
214220
a_info = (NXArchInfo *) NXGetLocalArchInfo();
215221
if (a_info) {

gcc/ChangeLog.apple

+61
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,64 @@
1+
2010-03-18 Stuart Hastings <[email protected]>
2+
3+
Radar 7763139
4+
* config/i386/i386.c (iasm_x86_canonicalize_operands): Add LEA
5+
to list of opcodes that ignore 2nd type attribute.
6+
7+
2010-03-16 Fariborz Jahanian <[email protected]>
8+
9+
Radar 7760213
10+
* c-common.h (HasByrefArray): New decl.
11+
* c-common.c (HasByrefArray): New definition.
12+
* c-typeck.c (build_external_ref): Diagnose access of
13+
__block array.
14+
15+
2010-03-12 Jim Grosbach <[email protected]>
16+
17+
Radar 7744816
18+
19+
* expmed.c (synth_mult): Remove incorrect special case handling for
20+
0xffffffff.
21+
22+
2010-03-12 Fariborz Jahanian <[email protected]>
23+
24+
Radar 7735196
25+
* c-parser.c (build_block_struct_initlist):
26+
Set BLOCK_USE_STRET flag in block descriptor for
27+
blocks which return their aggregate value in memory.
28+
* c-common.h (BLOCK_USE_STRET): New flag.
29+
30+
2010-03-05 Fariborz Jahanian <[email protected]>
31+
32+
Radar 7721728
33+
* c-typeck.c (build_external_ref): Diagnose
34+
importation of copied-in variables.
35+
36+
2010-02-16 Jim Grosbach <[email protected]>
37+
38+
Radar 7649286
39+
40+
* config/arm/arm.md (call_value_mem, call): Rename call_value_mem_v4,
41+
call_mem_v4. Restrict to only when blx is not available (pre-ARMv5).
42+
43+
2010-02-08 Jim Grosbach <[email protected]>
44+
45+
Radar 7590305
46+
* config/arm/arm.c (handle_thumb_unexpanded_prologue): When calling
47+
helper function to save off VFP regs, update the DWARF call frame
48+
information.
49+
50+
2010-02-01 Stuart Hastings <[email protected]>
51+
52+
Radar 7599272
53+
* gcc/config/darwin-c.c (create_init_utf16_var): Apply Evan's
54+
LLVM-GCC r95013 patch to GCC.
55+
56+
2010-01-27 Jim Grosbach <[email protected]>
57+
58+
Radar 7581650
59+
* dwarf2out.c (gen_subprogram_die): DW_AT_APPLE_isa should use data1
60+
encoding.
61+
162
2010-01-13 Jim Grosbach <[email protected]>
263

364
Radar 7511696

gcc/c-common.c

+16
Original file line numberDiff line numberDiff line change
@@ -9110,4 +9110,20 @@ tree build_block_object_dispose_call_exp (tree src, int flag)
91109110
return build_function_call (build_block_object_dispose_decl (), func_params);
91119111
}
91129112
/* APPLE LOCAL end radar 5847976 */
9113+
/* APPLE LOCAL begin radar 7760213 */
9114+
int HasByrefArray(tree byrefType)
9115+
{
9116+
tree s1;
9117+
/* Check for possibility of an error condition. */
9118+
if (TREE_CODE(byrefType) != RECORD_TYPE)
9119+
return 0;
9120+
9121+
for (s1 = TYPE_FIELDS (byrefType); s1; s1 = TREE_CHAIN (s1))
9122+
{
9123+
if (TREE_CODE(TREE_TYPE(s1)) == ARRAY_TYPE)
9124+
return 1;
9125+
}
9126+
return 0;
9127+
}
9128+
/* APPLE LOCAL end radar 7760213 */
91139129
#include "gt-c-common.h"

gcc/c-common.h

+5-2
Original file line numberDiff line numberDiff line change
@@ -1145,8 +1145,8 @@ enum {
11451145
BLOCK_IS_GC = (1 << 27),
11461146
/* APPLE LOCAL radar 5822844 */
11471147
BLOCK_IS_GLOBAL = (1 << 28),
1148-
/* APPLE LOCAL radar 5847213 */
1149-
BLOCK_HAS_DESCRIPTOR = (1 << 29)
1148+
/* APPLE LOCAL radar 7735196 */
1149+
BLOCK_USE_STRET = (1 << 29)
11501150
};
11511151

11521152
struct block_sema_info {
@@ -1231,6 +1231,9 @@ extern tree build_block_helper_name (int);
12311231
/* APPLE LOCAL radar 6353006 */
12321232
extern tree c_build_generic_block_struct_type (void);
12331233

1234+
/* APPLE LOCAL radar 7760213 */
1235+
extern int HasByrefArray(tree);
1236+
12341237
/* In c-omp.c */
12351238
extern tree c_finish_omp_master (tree);
12361239
extern tree c_finish_omp_critical (tree, tree);

gcc/c-parser.c

+8-3
Original file line numberDiff line numberDiff line change
@@ -9635,7 +9635,7 @@ build_descriptor_block_decl (tree block_struct_type, struct block_sema_info *blo
96359635
/**
96369636
build_block_struct_initlist - builds the initializer list:
96379637
{ &_NSConcreteStackBlock or &_NSConcreteGlobalBlock // __isa,
9638-
BLOCK_HAS_DESCRIPTOR | BLOCK_HAS_COPY_DISPOSE | BLOCK_IS_GLOBAL // __flags,
9638+
BLOCK_USE_STRET | BLOCK_HAS_COPY_DISPOSE | BLOCK_IS_GLOBAL // __flags,
96399639
0, // __reserved
96409640
&helper_1, // __FuncPtr,
96419641
&static_descriptor_variable // __descriptor,
@@ -9650,7 +9650,8 @@ build_block_struct_initlist (tree block_struct_type,
96509650
{
96519651
tree initlist, helper_addr;
96529652
tree chain, fields;
9653-
unsigned int flags = BLOCK_HAS_DESCRIPTOR;
9653+
/* APPLE LOCAL radar 7735196 */
9654+
unsigned int flags = 0;
96549655
static tree NSConcreteStackBlock_decl = NULL_TREE;
96559656
static tree NSConcreteGlobalBlock_decl = NULL_TREE;
96569657
tree descriptor_block_decl = build_descriptor_block_decl (block_struct_type, block_impl);
@@ -9660,6 +9661,10 @@ build_block_struct_initlist (tree block_struct_type,
96609661
we have destroy_helper_block/copy_helper_block helper
96619662
routines. */
96629663
flags |= BLOCK_HAS_COPY_DISPOSE;
9664+
/* APPLE LOCAL begin radar 7735196 */
9665+
if (block_impl->return_type && aggregate_value_p(block_impl->return_type, 0))
9666+
flags |= BLOCK_USE_STRET;
9667+
/* APPLE LOCAL end 7735196 */
96639668

96649669
fields = TYPE_FIELDS (block_struct_type);
96659670
/* APPLE LOCAL begin radar 6230297 */
@@ -9805,7 +9810,7 @@ build_block_struct_initlist (tree block_struct_type,
98059810
3) build the temporary initialization:
98069811
struct __block_literal_n I = {
98079812
&_NSConcreteStackBlock or &_NSConcreteGlobalBlock // __isa,
9808-
BLOCK_HAS_DESCRIPTOR | BLOCK_HAS_COPY_DISPOSE | BLOCK_IS_GLOBAL // __flags,
9813+
BLOCK_USE_STRET | BLOCK_HAS_COPY_DISPOSE | BLOCK_IS_GLOBAL // __flags,
98099814
0, // __reserved
98109815
&helper_1, // __FuncPtr
98119816
&static_descriptor_variable // __descriptor,

gcc/c-typeck.c

+13-2
Original file line numberDiff line numberDiff line change
@@ -2113,6 +2113,7 @@ build_array_ref (tree array, tree index)
21132113
"array indexing");
21142114
}
21152115
}
2116+
21162117

21172118
/* Build an external reference to identifier ID. FUN indicates
21182119
whether this will be used for a function call. LOC is the source
@@ -2176,20 +2177,30 @@ build_external_ref (tree id, int fun, location_t loc)
21762177
{
21772178
/* APPLE LOCAL begin radar 5803600 (C++ ci) */
21782179
/* byref globals are directly accessed. */
2179-
if (!gdecl)
2180+
/* APPLE LOCAL begin radar 7760213 */
2181+
if (!gdecl) {
2182+
if (HasByrefArray(TREE_TYPE (decl)))
2183+
error ("cannot access __block variable of array type inside block");
21802184
/* build a decl for the byref variable. */
21812185
decl = build_block_byref_decl (id, decl, decl);
2186+
}
2187+
/* APPLE LOCAL end radar 7760213 */
21822188
else
21832189
add_block_global_byref_list (decl);
21842190
}
21852191
else
21862192
{
21872193
/* 'byref' globals are never copied-in. So, do not add
21882194
them to the copied-in list. */
2189-
if (!in_block_global_byref_list (decl))
2195+
if (!in_block_global_byref_list (decl)) {
2196+
/* APPLE LOCAL begin radar 7721728 */
2197+
if (TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE)
2198+
error ("cannot access copied-in variable of array type inside block");
2199+
/* APPLE LOCAL end radar 7721728 */
21902200
/* build a new decl node. set its type to 'const' type
21912201
of the old decl. */
21922202
decl = build_block_ref_decl (id, decl);
2203+
}
21932204
/* APPLE LOCAL end radar 5803600 (C++ ci) */
21942205
/* APPLE LOCAL end radar 5803005 (C++ ci) */
21952206
}

gcc/config/arm/arm.c

+11-1
Original file line numberDiff line numberDiff line change
@@ -21223,7 +21223,17 @@ handle_thumb_unexpanded_prologue (FILE *f, bool emit)
2122321223
{
2122421224
bytes += 4;
2122521225
if (emit)
21226-
asm_fprintf (f, "\tblx ___save_vfp_d8_d15_regs\n");
21226+
{
21227+
asm_fprintf (f, "\tblx ___save_vfp_d8_d15_regs\n");
21228+
/* Let the debugger know about the additional space used */
21229+
if (dwarf2out_do_frame ())
21230+
{
21231+
char *l = dwarf2out_cfi_label ();
21232+
/* d8 - d15 save is 64 bytes of space */
21233+
cfa_offset = cfa_offset + 64;
21234+
dwarf2out_def_cfa (l, SP_REGNUM, cfa_offset);
21235+
}
21236+
}
2122721237
}
2122821238
/* APPLE LOCAL end 6465387 exception handling interworking VFP save */
2122921239
return bytes;

gcc/config/arm/arm.md

+8-4
Original file line numberDiff line numberDiff line change
@@ -8798,19 +8798,21 @@
87988798
(set_attr "predicable" "yes")]
87998799
)
88008800

8801-
(define_insn "*call_mem"
8801+
;; APPLE LOCAL begin 7649286 always use blx for indirect call when available
8802+
(define_insn "*call_mem_v4"
88028803
[(call (mem:SI (match_operand:SI 0 "call_memory_operand" "m"))
88038804
(match_operand 1 "" ""))
88048805
(use (match_operand 2 "" ""))
88058806
(clobber (reg:SI LR_REGNUM))]
8806-
"TARGET_ARM"
8807+
"TARGET_ARM && !arm_arch5"
88078808
"*
88088809
return output_call_mem (operands);
88098810
"
88108811
[(set_attr "length" "12")
88118812
(set_attr "type" "call")
88128813
(set_attr "predicable" "yes")]
88138814
)
8815+
;; APPLE LOCAL end 7649286 always use blx for indirect call when available
88148816

88158817
;; APPLE LOCAL v7 support. Merge from mainline
88168818
(define_insn "*call_reg_thumb1_v5"
@@ -8908,20 +8910,22 @@
89088910
(set_attr "predicable" "yes")]
89098911
)
89108912

8911-
(define_insn "*call_value_mem"
8913+
;; APPLE LOCAL begin 7649286 always use blx for indirect call when available
8914+
(define_insn "*call_value_mem_v4"
89128915
[(set (match_operand 0 "" "")
89138916
(call (mem:SI (match_operand:SI 1 "call_memory_operand" "m"))
89148917
(match_operand 2 "" "")))
89158918
(use (match_operand 3 "" ""))
89168919
(clobber (reg:SI LR_REGNUM))]
8917-
"TARGET_ARM && (!CONSTANT_ADDRESS_P (XEXP (operands[1], 0)))"
8920+
"TARGET_ARM && (!CONSTANT_ADDRESS_P (XEXP (operands[1], 0))) && !arm_arch5"
89188921
"*
89198922
return output_call_mem (&operands[1]);
89208923
"
89218924
[(set_attr "length" "12")
89228925
(set_attr "type" "call")
89238926
(set_attr "predicable" "yes")]
89248927
)
8928+
;; APPLE LOCAL end 7649286 always use blx for indirect call when available
89258929

89268930
;; APPLE LOCAL v7 support. Merge from mainline
89278931
(define_insn "*call_value_reg_thumb1_v5"

gcc/config/darwin-c.c

+19-3
Original file line numberDiff line numberDiff line change
@@ -1195,10 +1195,22 @@ create_init_utf16_var (const unsigned char *inbuf, size_t length, size_t *numUni
11951195
static int num;
11961196
const char *name_prefix = "__utf16_string_";
11971197
char *name;
1198+
int embedNull = 0;
11981199

11991200
if (!cvt_utf8_utf16 (inbuf, length, &uniCharBuf, numUniChars))
12001201
return NULL_TREE;
12011202

1203+
/* APPLE LOCAL begin 7589850 */
1204+
/* ustring with embedded null should go into __const. It should not be forced
1205+
into "__TEXT,__ustring" section. */
1206+
for (l = 0; l < length; l++) {
1207+
if (!inbuf[l]) {
1208+
embedNull = 1;
1209+
break;
1210+
}
1211+
}
1212+
/* APPLE LOCAL end 7589850 */
1213+
12021214
for (l = 0; l < *numUniChars; l++)
12031215
initlist = tree_cons (NULL_TREE, build_int_cst (char_type_node, uniCharBuf[l]), initlist);
12041216
type = build_array_type (char_type_node,
@@ -1212,9 +1224,13 @@ create_init_utf16_var (const unsigned char *inbuf, size_t length, size_t *numUni
12121224
DECL_ARTIFICIAL (decl) = 1;
12131225
DECL_CONTEXT (decl) = NULL_TREE;
12141226

1215-
attribute = tree_cons (NULL_TREE, build_string (len, section_name), NULL_TREE);
1216-
attribute = tree_cons (get_identifier ("section"), attribute, NULL_TREE);
1217-
decl_attributes (&decl, attribute, 0);
1227+
/* APPLE LOCAL begin 7589850 */
1228+
if (!embedNull) {
1229+
attribute = tree_cons (NULL_TREE, build_string (len, section_name), NULL_TREE);
1230+
attribute = tree_cons (get_identifier ("section"), attribute, NULL_TREE);
1231+
decl_attributes (&decl, attribute, 0);
1232+
}
1233+
/* APPLE LOCAL end 7589850 */
12181234
attribute = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 2), NULL_TREE);
12191235
attribute = tree_cons (get_identifier ("aligned"), attribute, NULL_TREE);
12201236
decl_attributes (&decl, attribute, 0);

gcc/config/darwin.h

+5
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,11 @@ do { \
418418
%{Zmultiplydefinedunused*:-multiply_defined_unused %*} \
419419
"/* APPLE LOCAL mainline 2007-06-01 5238485 */" \
420420
%{fpie:-pie} \
421+
"/* APPLE LOCAL begin <rdar://problem/7651045> */" \
422+
%{fPIE:-pie} \
423+
%{fno-pie:-no_pie} \
424+
%{fno-PIE:-no_pie} \
425+
"/* APPLE LOCAL end <rdar://problem/7651045> */" \
421426
%{prebind} %{noprebind} %{nofixprebinding} %{prebind_all_twolevel_modules} \
422427
%{read_only_relocs} \
423428
%{sectcreate*} %{sectorder*} %{seg1addr*} %{segprot*} \

gcc/config/i386/i386.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -23220,8 +23220,9 @@ iasm_x86_canonicalize_operands (const char **opcode_p, tree iargs, void *ep)
2322023220
|| strcasecmp (opcode, "str") == 0
2322123221
|| strcasecmp (opcode, "xlat") == 0)
2322223222
e->mod[0] = 0;
23223-
else if (strcasecmp (opcode, "rcr") == 0
23223+
else if (strcasecmp (opcode, "lea") == 0
2322423224
|| strcasecmp (opcode, "rcl") == 0
23225+
|| strcasecmp (opcode, "rcr") == 0
2322523226
|| strcasecmp (opcode, "rol") == 0
2322623227
|| strcasecmp (opcode, "ror") == 0
2322723228
|| strcasecmp (opcode, "sal") == 0

gcc/cp/ChangeLog.apple

+19
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
2010-03-16 Fariborz Jahanian <[email protected]>
2+
3+
Radar 7760213
4+
* semantics.c (get_final_block_variable): Diagnose
5+
access of __block array.
6+
7+
2010-03-12 Fariborz Jahanian <[email protected]>
8+
9+
Radar 7735196
10+
* cp/parser.c (build_block_struct_initlist):
11+
Set BLOCK_USE_STRET flag in block descriptor for
12+
blocks which return their aggregate value in memory.
13+
14+
2010-03-05 Fariborz Jahanian <[email protected]>
15+
16+
Radar 7721728
17+
* semantics.c (get_final_block_variable): Diagnose
18+
importation of copied-in variables.
19+
120
2010-01-05 Jim Grosbach <[email protected]>
221

322
Radar 7465602

0 commit comments

Comments
 (0)