diff options
Diffstat (limited to 'gcc/final.c')
-rw-r--r-- | gcc/final.c | 53 |
1 files changed, 34 insertions, 19 deletions
diff --git a/gcc/final.c b/gcc/final.c index bf5771aebfb..2adcd46487c 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -1,6 +1,7 @@ /* Convert RTL to assembler code and output it, for GNU compiler. Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, - 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 + Free Software Foundation, Inc. This file is part of GCC. @@ -835,7 +836,7 @@ shorten_branches (rtx first ATTRIBUTE_UNUSED) max_log = log; max_skip = LABEL_ALIGN_MAX_SKIP; } - next = NEXT_INSN (insn); + next = next_nonnote_insn (insn); /* ADDR_VECs only take room if read-only data goes into the text section. */ if (JUMP_TABLES_IN_TEXT_SECTION || !HAVE_READONLY_DATA_SECTION) @@ -1334,7 +1335,8 @@ asm_insn_count (rtx body) void final_start_function (rtx first ATTRIBUTE_UNUSED, FILE *file, - int optimize ATTRIBUTE_UNUSED) + /* APPLE LOCAL optimization pragmas 3124235/3420242 */ + int optimizing ATTRIBUTE_UNUSED) { block_depth = 0; @@ -1501,7 +1503,8 @@ final_end_function (void) Prescanning is done only on certain machines. */ void -final (rtx first, FILE *file, int optimize, int prescan) +/* APPLE LOCAL optimization pragmas 3124235/3420242 */ +final (rtx first, FILE *file, int optimizing, int prescan) { rtx insn; int max_uid = 0; @@ -1543,7 +1546,8 @@ final (rtx first, FILE *file, int optimize, int prescan) #ifdef HAVE_cc0 /* If CC tracking across branches is enabled, record the insn which jumps to each branch only reached from one place. */ - if (optimize && JUMP_P (insn)) + /* APPLE LOCAL optimization pragmas 3124235/3420242 */ + if (optimizing && JUMP_P (insn)) { rtx lab = JUMP_LABEL (insn); if (lab && LABEL_NUSES (lab) == 1) @@ -1573,7 +1577,8 @@ final (rtx first, FILE *file, int optimize, int prescan) insn_current_address = INSN_ADDRESSES (INSN_UID (insn)); #endif /* HAVE_ATTR_length */ - insn = final_scan_insn (insn, file, optimize, prescan, 0, &seen); + /* APPLE LOCAL optimization pragmas 3124235/3420242 */ + insn = final_scan_insn (insn, file, optimizing, prescan, 0, &seen); } } @@ -1670,13 +1675,15 @@ scan_ahead_for_unlikely_executed_note (rtx insn) first. */ rtx -final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, +/* APPLE LOCAL optimization pragmas 3124235/3420242 */ +final_scan_insn (rtx insn, FILE *file, int optimizing ATTRIBUTE_UNUSED, int prescan, int nopeepholes ATTRIBUTE_UNUSED, int *seen) { #ifdef HAVE_cc0 rtx set; #endif + rtx next; insn_counter++; @@ -1882,7 +1889,8 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, /* Disabled because some insns set cc_status in the C output code and NOTICE_UPDATE_CC alone can set incorrect status. */ - if (0 /* optimize && LABEL_NUSES (insn) == 1*/) + /* APPLE LOCAL optimization pragmas 3124235/3420242 */ + if (0 /* optimizing && LABEL_NUSES (insn) == 1*/) { rtx jump = LABEL_REFS (insn); rtx barrier = prev_nonnote_insn (insn); @@ -1932,10 +1940,11 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, fputs (ASM_APP_OFF, file); app_on = 0; } - if (NEXT_INSN (insn) != 0 - && JUMP_P (NEXT_INSN (insn))) + + next = next_nonnote_insn (insn); + if (next != 0 && JUMP_P (next)) { - rtx nextbody = PATTERN (NEXT_INSN (insn)); + rtx nextbody = PATTERN (next); /* If this label is followed by a jump-table, make sure we put the label in the read-only section. Also @@ -1956,7 +1965,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, targetm.asm_out.function_rodata_section (current_function_decl); #ifdef ADDR_VEC_ALIGN - log_align = ADDR_VEC_ALIGN (NEXT_INSN (insn)); + log_align = ADDR_VEC_ALIGN (next); #else log_align = exact_log2 (BIGGEST_ALIGNMENT / BITS_PER_UNIT); #endif @@ -1967,7 +1976,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, #ifdef ASM_OUTPUT_CASE_LABEL ASM_OUTPUT_CASE_LABEL (file, "L", CODE_LABEL_NUMBER (insn), - NEXT_INSN (insn)); + next); #else targetm.asm_out.internal_label (file, "L", CODE_LABEL_NUMBER (insn)); #endif @@ -2022,6 +2031,11 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, if (prescan > 0) break; + if (! JUMP_TABLES_IN_TEXT_SECTION) + targetm.asm_out.function_rodata_section (current_function_decl); + else + function_section (current_function_decl); + if (app_on) { fputs (ASM_APP_OFF, file); @@ -2157,7 +2171,6 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, { /* A delayed-branch sequence */ int i; - rtx next; if (prescan > 0) break; @@ -2225,7 +2238,8 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, and the next statement should reexamine the variable to compute the condition codes. */ - if (optimize) + /* APPLE LOCAL optimization pragmas 3124235/3420242 */ + if (optimizing) { if (set && GET_CODE (SET_DEST (set)) == CC0 @@ -2383,7 +2397,8 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, #ifdef HAVE_peephole /* Do machine-specific peephole optimizations if desired. */ - if (optimize && !flag_no_peephole && !nopeepholes) + /* APPLE LOCAL optimization pragmas 3124235/3420242 */ + if (optimizing && !flag_no_peephole && !nopeepholes) { rtx next = peephole (insn); /* When peepholing, if there were notes within the peephole, @@ -2394,7 +2409,8 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, for (note = NEXT_INSN (insn); note != next; note = NEXT_INSN (note)) - final_scan_insn (note, file, optimize, prescan, nopeepholes, seen); + /* APPLE LOCAL optimization pragmas 3124235/3420242 */ + final_scan_insn (note, file, optimizing, prescan, nopeepholes, seen); /* In case this is prescan, put the notes in proper position for later rescan. */ @@ -2632,11 +2648,10 @@ alter_subreg (rtx *xp) if (new != 0) *xp = new; - else + else if (REG_P (y)) { /* Simplify_subreg can't handle some REG cases, but we have to. */ unsigned int regno = subreg_regno (x); - gcc_assert (REG_P (y)); *xp = gen_rtx_REG_offset (y, GET_MODE (x), regno, SUBREG_BYTE (x)); } } |