Skip to content

Commit cedd1e6

Browse files
gcc-5493
Imported from gcc-5493.tar.gz
1 parent 65396bc commit cedd1e6

16 files changed

+237
-98
lines changed

ChangeLog.apple

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2008-10-24 Mike Stump <[email protected]>
2+
3+
Radar 6310626
4+
* configure.in (tentative_cc): Force initial x86 Darwin
5+
compiler to be built -m32.
6+
17
2008-01-17 Josh Conner <[email protected]>
28

39
* driverdriver.c (do_compile): Move malloc of

configure

Lines changed: 66 additions & 64 deletions
Large diffs are not rendered by default.

configure.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -952,6 +952,8 @@ case "${host}" in
952952
# APPLE LOCAL begin dynamic-no-pic
953953
i[[3456789]]86-*-darwin*)
954954
host_makefile_frag="config/mh-x86-darwin"
955+
# APPLE LOCAL 6310626
956+
CC="gcc -m32"
955957
;;
956958
# APPLE LOCAL end dynamic-no-pic
957959
*-*-lynxos*)

gcc/ChangeLog.apple

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
2009-01-30 Bob Wilson <[email protected]>
2+
3+
Backport from 4_2:
4+
2009-01-29 Josh Conner <[email protected]>
5+
Radar 6186914, 6541440
6+
* dwarf2out.c (dwarf_stack_op_name): Handle DW_OP_bit_piece.
7+
(size_of_loc_descr, output_loc_operands): Likewise.
8+
(reg_loc_descriptor): Call TARGET_DWARF2_REG_HANDLER if it is defined.
9+
* config/arm/arm.h (TARGET_DWARF2_REG_HANDLER): Define.
10+
11+
2008-10-21 Josh Conner <[email protected]>
12+
13+
Radar 6071851
14+
Backport from 4_2:
15+
2007-12-14 Josh Conner <[email protected]>
16+
Radar 5635246
17+
* final.c (calculate_alignments): New function.
18+
(shorten_branches): Move calculations of uid_align into
19+
calculate_alignments. Invoke when alignments change.
20+
121
2008-09-22 Stuart Hastings <[email protected]>
222

323
Radar 6185789

gcc/config/arm/arm.h

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2926,6 +2926,35 @@ extern int making_const_table;
29262926
? (gen_int_mode ((unsigned long)0xffffffff, Pmode)) \
29272927
: arm_gen_return_addr_mask ())
29282928

2929+
/* APPLE LOCAL begin 6186914 */
2930+
/* As per the ARM ABI, for double-width VFP regs:
2931+
Dx = DW_OP_regx(256+x)
2932+
For single-width VFP regs:
2933+
S[2x] = DW_OP_regx(256 + (x >> 1)) DW_OP_bit piece(32, 0)
2934+
S[2x+1] = DW_OP_regx(256 + (x >> 1)) DW_OP_bit_piece (32, 32)
2935+
It's unfortunate that we have to put this into inline code, but the
2936+
interfaces we need from dwarf2out.c aren't exposed. */
2937+
#define TARGET_DWARF2_REG_HANDLER(reg) \
2938+
do { \
2939+
if (IS_VFP_REGNUM (REGNO (reg)) \
2940+
&& (GET_MODE (reg) == SFmode || GET_MODE (reg) == DFmode)) \
2941+
{ \
2942+
dw_loc_descr_ref loc_result = NULL; \
2943+
dw_loc_descr_ref temp; \
2944+
unsigned int relative_regno = REGNO (reg) - FIRST_VFP_REGNUM; \
2945+
unsigned int base_reg = 256 + (relative_regno >> 1); \
2946+
temp = one_reg_loc_descriptor (base_reg); \
2947+
add_loc_descr (&loc_result, temp); \
2948+
if (GET_MODE (reg) == SFmode) \
2949+
{ \
2950+
int offset = relative_regno & 0x1 ? 32 : 0; \
2951+
temp = new_loc_descr (DW_OP_bit_piece, 32, offset); \
2952+
add_loc_descr (&loc_result, temp); \
2953+
} \
2954+
return loc_result; \
2955+
} \
2956+
} while (0)
2957+
/* APPLE LOCAL end 6186914 */
29292958

29302959
enum arm_builtins
29312960
{

gcc/dwarf2out.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3067,6 +3067,10 @@ dwarf_stack_op_name (unsigned int op)
30673067
return "DW_OP_bregx";
30683068
case DW_OP_piece:
30693069
return "DW_OP_piece";
3070+
/* APPLE LOCAL begin 6186914 */
3071+
case DW_OP_bit_piece:
3072+
return "DW_OP_bit_piece";
3073+
/* APPLE LOCAL end 6186914 */
30703074
case DW_OP_deref_size:
30713075
return "DW_OP_deref_size";
30723076
case DW_OP_xderef_size:
@@ -3214,6 +3218,12 @@ size_of_loc_descr (dw_loc_descr_ref loc)
32143218
case DW_OP_piece:
32153219
size += size_of_uleb128 (loc->dw_loc_oprnd1.v.val_unsigned);
32163220
break;
3221+
/* APPLE LOCAL begin 6186914 */
3222+
case DW_OP_bit_piece:
3223+
size += size_of_uleb128 (loc->dw_loc_oprnd1.v.val_unsigned);
3224+
size += size_of_uleb128 (loc->dw_loc_oprnd2.v.val_unsigned);
3225+
break;
3226+
/* APPLE LOCAL end 6186914 */
32173227
case DW_OP_deref_size:
32183228
case DW_OP_xderef_size:
32193229
size += 1;
@@ -3379,6 +3389,12 @@ output_loc_operands (dw_loc_descr_ref loc)
33793389
case DW_OP_piece:
33803390
dw2_asm_output_data_uleb128 (val1->v.val_unsigned, NULL);
33813391
break;
3392+
/* APPLE LOCAL begin 6186914 */
3393+
case DW_OP_bit_piece:
3394+
dw2_asm_output_data_uleb128 (val1->v.val_unsigned, NULL);
3395+
dw2_asm_output_data_uleb128 (val2->v.val_unsigned, NULL);
3396+
break;
3397+
/* APPLE LOCAL end 6186914 */
33823398
case DW_OP_deref_size:
33833399
case DW_OP_xderef_size:
33843400
dw2_asm_output_data (1, val1->v.val_int, NULL);
@@ -8820,6 +8836,16 @@ reg_loc_descriptor (rtx rtl)
88208836
reg = dbx_reg_number (rtl);
88218837
regs = targetm.dwarf_register_span (rtl);
88228838

8839+
/* APPLE LOCAL begin 6186914 */
8840+
#ifdef TARGET_DWARF2_REG_HANDLER
8841+
/* If this macro is defined, it should provide any target-specific
8842+
register debug info handling. The macro should return the
8843+
dw_loc_descr_ref if it performs any alternative handling, and
8844+
fall through otherwise. */
8845+
TARGET_DWARF2_REG_HANDLER (rtl);
8846+
#endif
8847+
/* APPLE LOCAL end 6186914 */
8848+
88238849
if (hard_regno_nregs[REGNO (rtl)][GET_MODE (rtl)] > 1
88248850
|| regs)
88258851
return multiple_reg_loc_descriptor (rtl, regs);

gcc/final.c

Lines changed: 43 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,8 @@ static void output_alternate_entry_point (FILE *, rtx);
224224
static tree get_mem_expr_from_op (rtx, int *);
225225
static void output_asm_operand_names (rtx *, int *, int);
226226
static void output_operand (rtx, int);
227+
/* APPLE LOCAL ARM compact switch tables */
228+
static void calculate_alignments (void);
227229
#ifdef LEAF_REGISTERS
228230
static void leaf_renumber_regs (rtx);
229231
#endif
@@ -778,14 +780,15 @@ shorten_branches (rtx first ATTRIBUTE_UNUSED)
778780
int max_skip;
779781
#ifdef HAVE_ATTR_length
780782
#define MAX_CODE_ALIGN 16
781-
rtx seq;
783+
/* APPLE LOCAL begin ARM compact switch tables */
784+
/* Removed seq. */
782785
int something_changed = 1;
783786
char *varying_length;
784787
rtx body;
785788
int uid;
786-
rtx align_tab[MAX_CODE_ALIGN];
787-
/* APPLE LOCAL ARM 4790140 compact switch tables */
789+
/* Removed align_tab. */
788790
bool asms_present = false;
791+
/* APPLE LOCAL end ARM compact switch tables */
789792

790793
#endif
791794

@@ -911,30 +914,11 @@ shorten_branches (rtx first ATTRIBUTE_UNUSED)
911914

912915
varying_length = xcalloc (max_uid, sizeof (char));
913916

914-
/* Initialize uid_align. We scan instructions
915-
from end to start, and keep in align_tab[n] the last seen insn
916-
that does an alignment of at least n+1, i.e. the successor
917-
in the alignment chain for an insn that does / has a known
918-
alignment of n. */
917+
/* APPLE LOCAL begin ARM compact switch tables */
919918
uid_align = xcalloc (max_uid, sizeof *uid_align);
919+
calculate_alignments ();
920+
/* APPLE LOCAL end ARM compact switch tables */
920921

921-
for (i = MAX_CODE_ALIGN; --i >= 0;)
922-
align_tab[i] = NULL_RTX;
923-
seq = get_last_insn ();
924-
for (; seq; seq = PREV_INSN (seq))
925-
{
926-
int uid = INSN_UID (seq);
927-
int log;
928-
log = (LABEL_P (seq) ? LABEL_TO_ALIGNMENT (seq) : 0);
929-
uid_align[uid] = align_tab[0];
930-
if (log)
931-
{
932-
/* Found an alignment label. */
933-
uid_align[uid] = align_tab[log];
934-
for (i = log - 1; i >= 0; i--)
935-
align_tab[i] = seq;
936-
}
937-
}
938922
#ifdef CASE_VECTOR_SHORTEN_MODE
939923
if (optimize)
940924
{
@@ -1264,6 +1248,7 @@ shorten_branches (rtx first ATTRIBUTE_UNUSED)
12641248
#ifdef TARGET_ARM
12651249
/* Label gets same alignment as table. */
12661250
LABEL_TO_ALIGNMENT (rel_lab) = ADDR_VEC_ALIGN (insn);
1251+
calculate_alignments ();
12671252
#endif
12681253
/* APPLE LOCAL end ARM 4790140 compact switch tables */
12691254
if (insn_lengths[uid] != old_length)
@@ -1357,6 +1342,39 @@ shorten_branches (rtx first ATTRIBUTE_UNUSED)
13571342
#endif /* HAVE_ATTR_length */
13581343
}
13591344

1345+
/* APPLE LOCAL begin ARM compact switch tables */
1346+
/* Initialize uid_align. We scan instructions
1347+
from end to start, and keep in align_tab[n] the last seen insn
1348+
that does an alignment of at least n+1, i.e. the successor
1349+
in the alignment chain for an insn that does / has a known
1350+
alignment of n. */
1351+
static void
1352+
calculate_alignments (void)
1353+
{
1354+
int i;
1355+
rtx seq;
1356+
rtx align_tab[MAX_CODE_ALIGN];
1357+
1358+
for (i = MAX_CODE_ALIGN; --i >= 0;)
1359+
align_tab[i] = NULL_RTX;
1360+
seq = get_last_insn ();
1361+
for (; seq; seq = PREV_INSN (seq))
1362+
{
1363+
int uid = INSN_UID (seq);
1364+
int log;
1365+
log = (LABEL_P (seq) ? LABEL_TO_ALIGNMENT (seq) : 0);
1366+
uid_align[uid] = align_tab[0];
1367+
if (log)
1368+
{
1369+
/* Found an alignment label. */
1370+
uid_align[uid] = align_tab[log];
1371+
for (i = log - 1; i >= 0; i--)
1372+
align_tab[i] = seq;
1373+
}
1374+
}
1375+
}
1376+
/* APPLE LOCAL end ARM compact switch tables */
1377+
13601378
#ifdef HAVE_ATTR_length
13611379
/* Given the body of an INSN known to be generated by an ASM statement, return
13621380
the number of machine instructions likely to be generated for this insn.

gcc/objc/ChangeLog.apple

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2008-11-25 Fariborz Jahanian <[email protected]>
2+
3+
Radar 6157135
4+
* objc-act.c (objc_delta_format_args): Ignore
5+
0 for the 2nd argument.
6+
17
2008-05-15 Josh Conner <[email protected]>
28

39
Radar 5926171

gcc/objc/objc-act.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12434,7 +12434,10 @@ objc_delta_format_args (tree format)
1243412434
if (first_arg_num_expr && TREE_CODE (first_arg_num_expr) == INTEGER_CST)
1243512435
{
1243612436
val = TREE_INT_CST_LOW (first_arg_num_expr);
12437-
TREE_VALUE (TREE_CHAIN (TREE_CHAIN (args))) = build_int_cst (NULL_TREE, val+2);
12437+
/* APPLE LOCAL begin radar 6157135 */
12438+
if (val != 0)
12439+
TREE_VALUE (TREE_CHAIN (TREE_CHAIN (args))) = build_int_cst (NULL_TREE, val+2);
12440+
/* APPLE LOCAL end radar 6157135 */
1243812441
}
1243912442
return format;
1244012443
}

gcc/testsuite/ChangeLog.apple

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2008-11-25 Fariborz Jahanian <[email protected]>
2+
3+
Radar 6157135
4+
* objc.dg/method-attribute-format-5.: New
5+
16
2008-09-22 Stuart Hastings <[email protected]>
27

38
Radar 6185789

gcc/testsuite/objc.dg/6204451.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* APPLE LOCAL 6204451 */
1+
/* APPLE LOCAL file 6204451 */
22
/* { dg-options "-O1 -framework Foundation" } */
33
/* { dg-do run } */
44

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/* APPLE LOCAL file 6157135 */
2+
/* Check for declaration and usage of 'format' __NSString sttribuet where number of
3+
first variarg is 0 */
4+
/* { dg-options "-Wformat" } */
5+
/* { dg-do compile } */
6+
#include <Foundation/Foundation.h>
7+
8+
@interface MyClass
9+
- (id)initWithFormat:(NSString *)format arguments:(va_list)argList __attribute__((format(__NSString__, 1, 0)));
10+
@end
11+
12+
void FOO (MyClass* p)
13+
{
14+
[p initWithFormat:(NSString *)nil arguments: 0];
15+
}

gcc/testsuite/objc.dg/property-16.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
/* APPLE LOCAL file radar 4660569 */
22
/* No warning here because accessor methods are INHERITED from NSButton */
33
/* APPLE LOCAL radar 4899595 */
4-
/* { dg-options "-fno-objc-new-property -mmacosx-version-min=10.5" } */
4+
/* { dg-options "-mmacosx-version-min=10.5" } */
55
/* { dg-do compile { target powerpc*-*-darwin* i?86*-*-darwin* } } */
66
#include <AppKit/AppKit.h>
77

88
@interface NSButton (Properties)
9-
@property NSString *title;
9+
@property (copy) NSString *title;
1010
@end
1111

1212
@implementation NSButton (Properties)
13+
@dynamic title;
1314
@end

gcc/testsuite/objc.dg/property-4.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
/* Program should compile with no error or warning. */
44
/* { dg-do compile { target powerpc*-*-darwin* i?86*-*-darwin* } } */
55
/* APPLE LOCAL radar 4899595 */
6-
/* { dg-options "-fno-objc-new-property -mmacosx-version-min=10.5 -fobjc-abi-version=2" } */
6+
/* { dg-options "-mmacosx-version-min=10.5" } */
77
#import <Cocoa/Cocoa.h>
88

99
@interface NSWindow (Properties)
1010
@property(readonly) NSSize size;
11-
@property(bycopy, dynamic) NSString* title;
11+
@property(copy) NSString* title;
1212
@end
1313

1414
@implementation NSWindow (Properties)
@@ -17,6 +17,8 @@ - (NSSize)size {
1717
return _frame.size;
1818
}
1919

20+
@dynamic title;
21+
2022
@end
2123

2224
int main(int argc, char **argv) {

gcc/testsuite/objc.dg/property-bycopy-3.m

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,20 @@
22
/* This test should not produce any error or warning when property name is
33
assigned to without use of 'self' qualifier. */
44
/* APPLE LOCAL radar 4899595 */
5-
/* { dg-options "-fno-objc-new-property -mmacosx-version-min=10.5" } */
5+
/* { dg-options "-mmacosx-version-min=10.5" } */
66
/* { dg-do compile { target powerpc*-*-darwin* i?86*-*-darwin* } } */
77

88
#include <Cocoa/Cocoa.h>
99

1010
@interface NamedObject : NSObject
11-
@property(ivar,bycopy) NSString *name;
11+
{
12+
NSString * name;
13+
}
14+
@property(copy) NSString *name;
1215
@end
1316

1417
@implementation NamedObject
18+
@synthesize name;
1519
- (id)init {
1620
if (self = [super init]) {
1721
self.name = @"no name"; // no warning or error.

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 5490)";
19+
const char version_string[] = "4.0.1 (Apple Inc. build 5493)";
2020
/* APPLE LOCAL end Apple version */
2121

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

0 commit comments

Comments
 (0)