Deleted Added
full compact
3c3,4
< 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
---
> 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
> Free Software Foundation, Inc.
19,20c20,21
< Software Foundation, 59 Temple Place - Suite 330, Boston, MA
< 02111-1307, USA. */
---
> Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
> 02110-1301, USA. */
73a75,78
> #include "tree-pass.h"
> #include "timevar.h"
> #include "cgraph.h"
> #include "coverage.h"
87a93,96
> #ifdef SDB_DEBUGGING_INFO
> #include "sdbout.h"
> #endif
>
108,113d116
< #if defined(READONLY_DATA_SECTION) || defined(READONLY_DATA_SECTION_ASM_OP)
< #define HAVE_READONLY_DATA_SECTION 1
< #else
< #define HAVE_READONLY_DATA_SECTION 0
< #endif
<
135c138,139
< extern int length_unit_log; /* This is defined in insn-attrtab.c. */
---
> /* Whether to force emission of a line note before the next insn. */
> static bool force_source_line = false;
136a141,142
> extern const int length_unit_log; /* This is defined in insn-attrtab.c. */
>
138c144
< This means that inconsistencies are the user's fault, so don't abort.
---
> This means that inconsistencies are the user's fault, so don't die.
377,380c383,387
< get its actual length. Otherwise, get its maximum length. */
<
< int
< get_attr_length (rtx insn ATTRIBUTE_UNUSED)
---
> get its actual length. Otherwise, use FALLBACK_FN to calculate the
> length. */
> static inline int
> get_attr_length_1 (rtx insn ATTRIBUTE_UNUSED,
> int (*fallback_fn) (rtx) ATTRIBUTE_UNUSED)
398c405
< length = insn_default_length (insn);
---
> length = fallback_fn (insn);
409c416
< length = insn_default_length (insn);
---
> length = fallback_fn (insn);
418c425
< length = asm_insn_count (body) * insn_default_length (insn);
---
> length = asm_insn_count (body) * fallback_fn (insn);
423c430
< length = insn_default_length (insn);
---
> length = fallback_fn (insn);
435a443,444
> #define insn_default_length 0
> #define insn_min_length 0
437a447,462
>
> /* Obtain the current length of an insn. If branch shortening has been done,
> get its actual length. Otherwise, get its maximum length. */
> int
> get_attr_length (rtx insn)
> {
> return get_attr_length_1 (insn, insn_default_length);
> }
>
> /* Obtain the current length of an insn. If branch shortening has been done,
> get its actual length. Otherwise, get its minimum length. */
> int
> get_attr_min_length (rtx insn)
> {
> return get_attr_length_1 (insn, insn_min_length);
> }
628c653
< if (GET_CODE (branch) != JUMP_INSN)
---
> if (!JUMP_P (branch))
654c679,682
< void
---
> /* Compute branch alignments based on frequency information in the
> CFG. */
>
> static unsigned int
668,669c696
< label_align = xcalloc (max_labelno - min_labelno + 1,
< sizeof (struct label_alignment));
---
> label_align = XCNEWVEC (struct label_alignment, max_labelno - min_labelno + 1);
673c700
< return;
---
> return 0;
679a707
> edge_iterator ei;
681c709
< if (GET_CODE (label) != CODE_LABEL
---
> if (!LABEL_P (label)
687c715
< for (e = bb->pred; e; e = e->pred_next)
---
> FOR_EACH_EDGE (e, ei, bb->preds)
734a763
> return 0;
735a765,782
>
> struct tree_opt_pass pass_compute_alignments =
> {
> NULL, /* name */
> NULL, /* gate */
> compute_alignments, /* execute */
> NULL, /* sub */
> NULL, /* next */
> 0, /* static_pass_number */
> 0, /* tv_id */
> 0, /* properties_required */
> 0, /* properties_provided */
> 0, /* properties_destroyed */
> 0, /* todo_flags_start */
> 0, /* todo_flags_finish */
> 0 /* letter */
> };
>
770c817,818
< uid_shuid = xmalloc (max_uid * sizeof *uid_shuid);
---
> /* Free uid_shuid before reallocating it. */
> free (uid_shuid);
771a820,821
> uid_shuid = XNEWVEC (int, max_uid);
>
786c836
< /* Range of labels grows monotonically in the function. Abort here
---
> /* Range of labels grows monotonically in the function. Failing here
788,789c838
< if (n_old_labels > n_labels)
< abort ();
---
> gcc_assert (n_old_labels <= n_labels);
809a859,861
> continue;
>
> if (LABEL_P (insn))
811,818d862
< /* reorg might make the first insn of a loop being run once only,
< and delete the label in front of it. Then we want to apply
< the loop alignment to the new label created by reorg, which
< is separated by the former loop start insn from the
< NOTE_INSN_LOOP_BEG. */
< }
< else if (GET_CODE (insn) == CODE_LABEL)
< {
835c879
< next = NEXT_INSN (insn);
---
> next = next_nonnote_insn (insn);
838,839c882,884
< if (JUMP_TABLES_IN_TEXT_SECTION || !HAVE_READONLY_DATA_SECTION)
< if (next && GET_CODE (next) == JUMP_INSN)
---
> if (JUMP_TABLES_IN_TEXT_SECTION
> || readonly_data_section == text_section)
> if (next && JUMP_P (next))
858c903
< else if (GET_CODE (insn) == BARRIER)
---
> else if (BARRIER_P (insn))
864c909
< if (GET_CODE (label) == CODE_LABEL)
---
> if (LABEL_P (label))
879c924
< insn_lengths = xmalloc (max_uid * sizeof (*insn_lengths));
---
> insn_lengths = XNEWVEC (int, max_uid);
885c930
< varying_length = xcalloc (max_uid, sizeof (char));
---
> varying_length = XCNEWVEC (char, max_uid);
892c937
< uid_align = xcalloc (max_uid, sizeof *uid_align);
---
> uid_align = XCNEWVEC (rtx, max_uid);
901c946
< log = (GET_CODE (seq) == CODE_LABEL ? LABEL_TO_ALIGNMENT (seq) : 0);
---
> log = (LABEL_P (seq) ? LABEL_TO_ALIGNMENT (seq) : 0);
928c973
< if (GET_CODE (insn) != JUMP_INSN
---
> if (!JUMP_P (insn)
933,934c978
< if (len <= 0)
< abort ();
---
> gcc_assert (len > 0);
953,954c997,998
< XEXP (pat, 2) = gen_rtx_LABEL_REF (VOIDmode, min_lab);
< XEXP (pat, 3) = gen_rtx_LABEL_REF (VOIDmode, max_lab);
---
> XEXP (pat, 2) = gen_rtx_LABEL_REF (Pmode, min_lab);
> XEXP (pat, 3) = gen_rtx_LABEL_REF (Pmode, max_lab);
956a1001
> memset (&flags, 0, sizeof (flags));
977c1022
< if (GET_CODE (insn) == CODE_LABEL)
---
> if (LABEL_P (insn))
990,991c1035,1036
< if (GET_CODE (insn) == NOTE || GET_CODE (insn) == BARRIER
< || GET_CODE (insn) == CODE_LABEL)
---
> if (NOTE_P (insn) || BARRIER_P (insn)
> || LABEL_P (insn))
1001c1046,1047
< if (JUMP_TABLES_IN_TEXT_SECTION || !HAVE_READONLY_DATA_SECTION)
---
> if (JUMP_TABLES_IN_TEXT_SECTION
> || readonly_data_section == text_section)
1082c1128
< if (GET_CODE (insn) == CODE_LABEL)
---
> if (LABEL_P (insn))
1107c1153
< if (optimize && GET_CODE (insn) == JUMP_INSN
---
> if (optimize && JUMP_P (insn)
1202c1248,1249
< if (JUMP_TABLES_IN_TEXT_SECTION || !HAVE_READONLY_DATA_SECTION)
---
> if (JUMP_TABLES_IN_TEXT_SECTION
> || readonly_data_section == text_section)
1217c1264
< if (GET_CODE (insn) == INSN
---
> if (NONJUMP_INSN_P (insn)
1239c1286
< if (GET_CODE (insn) == INSN && GET_CODE (PATTERN (insn)) == SEQUENCE)
---
> if (NONJUMP_INSN_P (insn) && GET_CODE (PATTERN (insn)) == SEQUENCE)
1347c1394
< #if defined (DWARF2_UNWIND_INFO) || defined (IA64_UNWIND_INFO)
---
> #if defined (DWARF2_UNWIND_INFO) || defined (TARGET_UNWIND_INFO)
1366c1413
< dwarf2out_frame_debug (NULL_RTX);
---
> dwarf2out_frame_debug (NULL_RTX, false);
1373d1419
< remove_unnecessary_notes ();
1383c1429
< (*targetm.asm_out.function_prologue) (file, get_frame_size ());
---
> targetm.asm_out.function_prologue (file, get_frame_size ());
1412c1458
< int cxt = current_function_needs_context;
---
> int cxt = cfun->static_chain_decl != NULL;
1419c1465
< data_section ();
---
> switch_to_section (data_section);
1421c1467
< (*targetm.asm_out.internal_label) (file, "LP", current_function_funcdef_no);
---
> targetm.asm_out.internal_label (file, "LP", current_function_funcdef_no);
1425c1471
< function_section (current_function_decl);
---
> switch_to_section (current_function_section ());
1428c1474
< if (sval && svrtx != NULL_RTX && GET_CODE (svrtx) == REG)
---
> if (sval && svrtx != NULL_RTX && REG_P (svrtx))
1459c1505
< if (sval && svrtx != NULL_RTX && GET_CODE (svrtx) == REG)
---
> if (sval && svrtx != NULL_RTX && REG_P (svrtx))
1477c1523
< (*targetm.asm_out.function_epilogue) (asm_out_file, get_frame_size ());
---
> targetm.asm_out.function_epilogue (asm_out_file, get_frame_size ());
1490c1536
< For description of args, see `final_start_function', above.
---
> For description of args, see `final_start_function', above. */
1492,1499d1537
< PRESCAN is 1 if we are not really outputting,
< just scanning as if we were outputting.
< Prescanning deletes and rearranges insns just like ordinary output.
< PRESCAN is -2 if we are outputting after having prescanned.
< In this case, don't try to delete or rearrange insns
< because that has already been done.
< Prescanning is done only on certain machines. */
<
1501c1539
< final (rtx first, FILE *file, int optimize, int prescan)
---
> final (rtx first, FILE *file, int optimize)
1517c1555
< if (GET_CODE (insn) == NOTE && NOTE_LINE_NUMBER (insn) > 0)
---
> if (NOTE_P (insn) && NOTE_LINE_NUMBER (insn) > 0)
1519,1523c1557,1564
< if ((RTX_INTEGRATED_P (insn)
< && strcmp (NOTE_SOURCE_FILE (insn), main_input_filename) != 0)
< || (last != 0
< && NOTE_LINE_NUMBER (insn) == NOTE_LINE_NUMBER (last)
< && NOTE_SOURCE_FILE (insn) == NOTE_SOURCE_FILE (last)))
---
> if (last != 0
> #ifdef USE_MAPPED_LOCATION
> && NOTE_SOURCE_LOCATION (insn) == NOTE_SOURCE_LOCATION (last)
> #else
> && NOTE_LINE_NUMBER (insn) == NOTE_LINE_NUMBER (last)
> && NOTE_SOURCE_FILE (insn) == NOTE_SOURCE_FILE (last)
> #endif
> )
1540c1581
< if (optimize && GET_CODE (insn) == JUMP_INSN)
---
> if (optimize && JUMP_P (insn))
1563,1566c1604,1605
< if (GET_CODE (insn) == NOTE)
< insn_current_address = -1;
< else
< abort ();
---
> gcc_assert (NOTE_P (insn));
> insn_current_address = -1;
1572c1611
< insn = final_scan_insn (insn, file, optimize, prescan, 0, &seen);
---
> insn = final_scan_insn (insn, file, optimize, 0, &seen);
1586,1587c1625
< if (insn == NULL)
< abort ();
---
> gcc_assert (insn);
1591c1629
< abort ();
---
> gcc_unreachable ();
1612c1650
< (*targetm.asm_out.globalize_label) (file, name);
---
> targetm.asm_out.globalize_label (file, name);
1622c1660
< abort ();
---
> gcc_unreachable ();
1642,1643c1680
< int prescan, int nopeepholes ATTRIBUTE_UNUSED,
< int *seen)
---
> int nopeepholes ATTRIBUTE_UNUSED, int *seen)
1647a1685
> rtx next;
1659,1661d1696
< if (prescan > 0)
< break;
<
1665,1669d1699
< case NOTE_INSN_LOOP_BEG:
< case NOTE_INSN_LOOP_END:
< case NOTE_INSN_LOOP_END_TOP_COND:
< case NOTE_INSN_LOOP_CONT:
< case NOTE_INSN_LOOP_VTOP:
1674a1705,1710
> case NOTE_INSN_SWITCH_TEXT_SECTIONS:
> in_cold_section_p = !in_cold_section_p;
> (*debug_hooks->switch_text_section) ();
> switch_to_section (current_function_section ());
> break;
>
1676,1677c1712,1713
< #ifdef IA64_UNWIND_INFO
< IA64_UNWIND_EMIT (asm_out_file, insn);
---
> #ifdef TARGET_UNWIND_INFO
> targetm.asm_out.unwind_emit (asm_out_file, insn);
1678a1715
>
1686c1723
< last_filename = NULL;
---
> force_source_line = true;
1704c1741
< (*targetm.asm_out.function_end_prologue) (file);
---
> targetm.asm_out.function_end_prologue (file);
1710c1747
< last_filename = NULL;
---
> force_source_line = true;
1718c1755
< (*targetm.asm_out.function_begin_epilogue) (file);
---
> targetm.asm_out.function_begin_epilogue (file);
1728c1765
< last_filename = NULL;
---
> force_source_line = true;
1738d1774
< || write_symbols == DWARF_DEBUG
1760d1795
< || write_symbols == DWARF_DEBUG
1771,1772c1806
< if (block_depth < 0)
< abort ();
---
> gcc_assert (block_depth >= 0);
1784a1819,1822
> case NOTE_INSN_VAR_LOCATION:
> (*debug_hooks->var_location) (insn);
> break;
>
1789,1790c1827
< if (NOTE_LINE_NUMBER (insn) <= 0)
< abort ();
---
> gcc_assert (NOTE_LINE_NUMBER (insn) > 0);
1798c1835
< dwarf2out_frame_debug (insn);
---
> dwarf2out_frame_debug (insn, false);
1842,1843c1879,1880
< if (barrier && GET_CODE (barrier) == BARRIER
< && jump && GET_CODE (jump) == JUMP_INSN
---
> if (barrier && BARRIER_P (barrier)
> && jump && JUMP_P (jump)
1845c1882
< && GET_CODE (prev) == INSN)
---
> && NONJUMP_INSN_P (prev))
1852,1853d1888
< if (prescan > 0)
< break;
1863,1864c1898,1900
< if (NEXT_INSN (insn) != 0
< && GET_CODE (NEXT_INSN (insn)) == JUMP_INSN)
---
>
> next = next_nonnote_insn (insn);
> if (next != 0 && JUMP_P (next))
1866c1902
< rtx nextbody = PATTERN (NEXT_INSN (insn));
---
> rtx nextbody = PATTERN (next);
1884c1920,1921
< readonly_data_section ();
---
> switch_to_section (targetm.asm_out.function_rodata_section
> (current_function_decl));
1887c1924
< log_align = ADDR_VEC_ALIGN (NEXT_INSN (insn));
---
> log_align = ADDR_VEC_ALIGN (next);
1894c1931
< function_section (current_function_decl);
---
> switch_to_section (current_function_section ());
1898c1935
< NEXT_INSN (insn));
---
> next);
1900c1937
< (*targetm.asm_out.internal_label) (file, "L", CODE_LABEL_NUMBER (insn));
---
> targetm.asm_out.internal_label (file, "L", CODE_LABEL_NUMBER (insn));
1909c1946
< (*targetm.asm_out.internal_label) (file, "L", CODE_LABEL_NUMBER (insn));
---
> targetm.asm_out.internal_label (file, "L", CODE_LABEL_NUMBER (insn));
1917d1953
< rtx note;
1918a1955,1958
> #ifdef HAVE_conditional_execution
> /* Reset this early so it is correct for ASM statements. */
> current_insn_predicate = NULL_RTX;
> #endif
1927,1930c1967,1971
< /* If there is a REG_CC_SETTER note on this insn, it means that
< the setting of the condition code was done in the delay slot
< of the insn that branched here. So recover the cc status
< from the insn that set it. */
---
> {
> /* If there is a REG_CC_SETTER note on this insn, it means that
> the setting of the condition code was done in the delay slot
> of the insn that branched here. So recover the cc status
> from the insn that set it. */
1932,1937c1973,1979
< note = find_reg_note (insn, REG_CC_SETTER, NULL_RTX);
< if (note)
< {
< NOTICE_UPDATE_CC (PATTERN (XEXP (note, 0)), XEXP (note, 0));
< cc_prev_status = cc_status;
< }
---
> rtx note = find_reg_note (insn, REG_CC_SETTER, NULL_RTX);
> if (note)
> {
> NOTICE_UPDATE_CC (PATTERN (XEXP (note, 0)), XEXP (note, 0));
> cc_prev_status = cc_status;
> }
> }
1949,1950c1991,1995
< if (prescan > 0)
< break;
---
> if (! JUMP_TABLES_IN_TEXT_SECTION)
> switch_to_section (targetm.asm_out.function_rodata_section
> (current_function_decl));
> else
> switch_to_section (current_function_section ());
1964c2009
< abort ();
---
> gcc_unreachable ();
1972c2017
< abort ();
---
> gcc_unreachable ();
1985c2030
< abort ();
---
> gcc_unreachable ();
1997c2042
< abort ();
---
> gcc_unreachable ();
2008c2053
< function_section (current_function_decl);
---
> switch_to_section (current_function_section ());
2025,2026d2069
< if (prescan > 0)
< break;
2049,2050d2091
< if (prescan > 0)
< break;
2054c2095
< /* Inhibit aborts on what would otherwise be compiler bugs. */
---
> /* Inhibit dieing on what would otherwise be compiler bugs. */
2077c2118
< if (prescan <= 0 && app_on)
---
> if (app_on)
2087d2127
< rtx next;
2089,2090d2128
< if (prescan > 0)
< break;
2098c2136
< dwarf2out_frame_debug (XVECEXP (body, 0, i));
---
> dwarf2out_frame_debug (XVECEXP (body, 0, i), false);
2106c2144
< next = final_scan_insn (XVECEXP (body, 0, 0), file, 0, prescan, 1, seen);
---
> next = final_scan_insn (XVECEXP (body, 0, 0), file, 0, 1, seen);
2120c2158
< insn = final_scan_insn (insn, file, 0, prescan, 1, seen);
---
> insn = final_scan_insn (insn, file, 0, 1, seen);
2133c2171
< if (GET_CODE (XVECEXP (body, 0, 0)) == CALL_INSN)
---
> if (CALL_P (XVECEXP (body, 0, 0)))
2191,2204d2228
< #ifndef STACK_REGS
< /* Don't bother outputting obvious no-ops, even without -O.
< This optimization is fast and doesn't interfere with debugging.
< Don't do this if the insn is in a delay slot, since this
< will cause an improper number of delay insns to be written. */
< if (final_sequence == 0
< && prescan >= 0
< && GET_CODE (insn) == INSN && GET_CODE (body) == SET
< && GET_CODE (SET_SRC (body)) == REG
< && GET_CODE (SET_DEST (body)) == REG
< && REGNO (SET_SRC (body)) == REGNO (SET_DEST (body)))
< break;
< #endif
<
2212c2236
< && GET_CODE (insn) == JUMP_INSN
---
> && JUMP_P (insn)
2216,2220c2240,2241
< && GET_RTX_CLASS (GET_CODE (XEXP (SET_SRC (body), 0))) == '<'
< && XEXP (XEXP (SET_SRC (body), 0), 0) == cc0_rtx
< /* This is done during prescan; it is not done again
< in final scan when prescan has been done. */
< && prescan >= 0)
---
> && COMPARISON_P (XEXP (SET_SRC (body), 0))
> && XEXP (XEXP (SET_SRC (body), 0), 0) == cc0_rtx)
2261c2282
< if (GET_CODE (insn) != JUMP_INSN
---
> if (!JUMP_P (insn)
2320c2341
< rtx prev = PREV_INSN (insn);
---
> rtx note, prev = PREV_INSN (insn);
2324c2345
< final_scan_insn (note, file, optimize, prescan, nopeepholes, seen);
---
> final_scan_insn (note, file, optimize, nopeepholes, seen);
2326,2327c2347,2350
< /* In case this is prescan, put the notes
< in proper position for later rescan. */
---
> /* Put the notes in the proper position for a later
> rescan. For example, the SH target can do this
> when generating a far jump in a delayed branch
> sequence. */
2371,2372d2393
< else
< current_insn_predicate = NULL_RTX;
2389,2390c2410,2411
< if (GET_CODE (insn) == CALL_INSN && dwarf2out_do_frame ())
< dwarf2out_frame_debug (insn);
---
> if (CALL_P (insn) && dwarf2out_do_frame ())
> dwarf2out_frame_debug (insn, false);
2403,2404c2424
< if (prev_nonnote_insn (insn) != last_ignored_compare)
< abort ();
---
> gcc_assert (prev_nonnote_insn (insn) == last_ignored_compare);
2414c2434
< if (GET_CODE (prev) == NOTE)
---
> if (NOTE_P (prev))
2435c2455
< abort ();
---
> gcc_unreachable ();
2441,2445c2461,2465
< if (prescan > 0)
< break;
<
< #ifdef IA64_UNWIND_INFO
< IA64_UNWIND_EMIT (asm_out_file, insn);
---
> #ifdef TARGET_UNWIND_INFO
> /* ??? This will put the directives in the wrong place if
> get_insn_template outputs assembly directly. However calling it
> before get_insn_template breaks if the insns is split. */
> targetm.asm_out.unwind_emit (asm_out_file, insn);
2447d2466
< /* Output assembler code from the template. */
2448a2468
> /* Output assembler code from the template. */
2455c2475
< if (GET_CODE (insn) == INSN
---
> if (final_sequence == 0
2459d2478
< && final_sequence == 0
2461c2480
< dwarf2out_frame_debug (insn);
---
> dwarf2out_frame_debug (insn, true);
2464,2475d2482
< #if 0
< /* It's not at all clear why we did this and doing so used to
< interfere with tests that used REG_WAS_0 notes, which are
< now gone, so let's try with this out. */
<
< /* Mark this insn as having been output. */
< INSN_DELETED_P (insn) = 1;
< #endif
<
< /* Emit information for vtable gc. */
< note = find_reg_note (insn, REG_VTABLE_REF, NULL_RTX);
<
2482,2483c2489
< /* Output debugging info to the assembler file FILE
< based on the NOTE-insn INSN, assumed to be a line number. */
---
> /* Return whether a source line note needs to be emitted before INSN. */
2491c2497,2500
< if (filename && (filename != last_filename || last_linenum != linenum))
---
> if (filename
> && (force_source_line
> || filename != last_filename
> || last_linenum != linenum))
2492a2502
> force_source_line = false;
2521c2531
< || GET_CODE (recog_data.operand[i]) == MEM)
---
> || MEM_P (recog_data.operand[i]))
2531c2541
< || GET_CODE (*recog_data.dup_loc[i]) == MEM)
---
> || MEM_P (*recog_data.dup_loc[i]))
2547,2548c2557,2575
< if (GET_CODE (y) == MEM)
< *xp = adjust_address (y, GET_MODE (x), SUBREG_BYTE (x));
---
> if (MEM_P (y))
> {
> int offset = SUBREG_BYTE (x);
>
> /* For paradoxical subregs on big-endian machines, SUBREG_BYTE
> contains 0 instead of the proper offset. See simplify_subreg. */
> if (offset == 0
> && GET_MODE_SIZE (GET_MODE (y)) < GET_MODE_SIZE (GET_MODE (x)))
> {
> int difference = GET_MODE_SIZE (GET_MODE (y))
> - GET_MODE_SIZE (GET_MODE (x));
> if (WORDS_BIG_ENDIAN)
> offset += (difference / UNITS_PER_WORD) * UNITS_PER_WORD;
> if (BYTES_BIG_ENDIAN)
> offset += difference % UNITS_PER_WORD;
> }
>
> *xp = adjust_address (y, GET_MODE (x), offset);
> }
2556,2557c2583
< /* Simplify_subreg can't handle some REG cases, but we have to. */
< else if (GET_CODE (y) == REG)
---
> else if (REG_P (y))
2559c2585,2586
< unsigned int regno = subreg_hard_regno (x, 1);
---
> /* Simplify_subreg can't handle some REG cases, but we have to. */
> unsigned int regno = subreg_regno (x);
2562,2563d2588
< else
< abort ();
2578a2604
> case AND:
2583a2610
> case ZERO_EXTEND:
2712c2739
< abort ();
---
> gcc_unreachable ();
2762c2789
< output_operand_lossage (const char *msgid, ...)
---
> output_operand_lossage (const char *cmsgid, ...)
2769c2796
< va_start (ap, msgid);
---
> va_start (ap, cmsgid);
2771,2772c2798,2799
< pfx_str = this_is_asm_operands ? _("invalid `asm': ") : "output_operand: ";
< asprintf (&fmt_string, "%s%s", pfx_str, _(msgid));
---
> pfx_str = this_is_asm_operands ? _("invalid 'asm': ") : "output_operand: ";
> asprintf (&fmt_string, "%s%s", pfx_str, _(cmsgid));
2823c2850
< if (GET_CODE (op) == REG)
---
> if (REG_P (op))
2825c2852
< else if (GET_CODE (op) != MEM)
---
> else if (!MEM_P (op))
2844,2845c2871,2872
< while (GET_RTX_CLASS (GET_CODE (op)) == '1'
< || GET_RTX_CLASS (GET_CODE (op)) == '2')
---
> while (GET_RTX_CLASS (GET_CODE (op)) == RTX_UNARY
> || GET_RTX_CLASS (GET_CODE (op)) == RTX_BIN_ARITH)
3024c3051,3052
< c = atoi (p);
---
> unsigned long opnum;
> char *endptr;
3026,3029c3054,3059
< if (! ISDIGIT (*p))
< output_operand_lossage ("operand number missing after %%-letter");
< else if (this_is_asm_operands
< && (c < 0 || (unsigned int) c >= insn_noperands))
---
> opnum = strtoul (p, &endptr, 10);
>
> if (endptr == p)
> output_operand_lossage ("operand number missing "
> "after %%-letter");
> else if (this_is_asm_operands && opnum >= insn_noperands)
3032c3062
< output_asm_label (operands[c]);
---
> output_asm_label (operands[opnum]);
3034c3064
< output_address (operands[c]);
---
> output_address (operands[opnum]);
3037,3038c3067,3068
< if (CONSTANT_ADDRESS_P (operands[c]))
< output_addr_const (asm_out_file, operands[c]);
---
> if (CONSTANT_ADDRESS_P (operands[opnum]))
> output_addr_const (asm_out_file, operands[opnum]);
3040c3070
< output_operand (operands[c], 'c');
---
> output_operand (operands[opnum], 'c');
3044c3074
< if (GET_CODE (operands[c]) == CONST_INT)
---
> if (GET_CODE (operands[opnum]) == CONST_INT)
3046c3076
< - INTVAL (operands[c]));
---
> - INTVAL (operands[opnum]));
3050c3080
< output_addr_const (asm_out_file, operands[c]);
---
> output_addr_const (asm_out_file, operands[opnum]);
3054c3084
< output_operand (operands[c], letter);
---
> output_operand (operands[opnum], letter);
3056,3058c3086,3088
< if (!opoutput[c])
< oporder[ops++] = c;
< opoutput[c] = 1;
---
> if (!opoutput[opnum])
> oporder[ops++] = opnum;
> opoutput[opnum] = 1;
3060,3061c3090,3091
< while (ISDIGIT (c = *p))
< p++;
---
> p = endptr;
> c = *p;
3066,3068c3096,3100
< c = atoi (p);
< if (this_is_asm_operands
< && (c < 0 || (unsigned int) c >= insn_noperands))
---
> unsigned long opnum;
> char *endptr;
>
> opnum = strtoul (p, &endptr, 10);
> if (this_is_asm_operands && opnum >= insn_noperands)
3071c3103
< output_operand (operands[c], 0);
---
> output_operand (operands[opnum], 0);
3073,3075c3105,3107
< if (!opoutput[c])
< oporder[ops++] = c;
< opoutput[c] = 1;
---
> if (!opoutput[opnum])
> oporder[ops++] = opnum;
> opoutput[opnum] = 1;
3077,3078c3109,3110
< while (ISDIGIT (c = *p))
< p++;
---
> p = endptr;
> c = *p;
3113,3114c3145,3146
< if (GET_CODE (x) == CODE_LABEL
< || (GET_CODE (x) == NOTE
---
> if (LABEL_P (x)
> || (NOTE_P (x)
3118c3150
< output_operand_lossage ("`%%l' operand isn't a label");
---
> output_operand_lossage ("'%%l' operand isn't a label");
3139,3140c3171,3172
< /* If X is a pseudo-register, abort now rather than writing trash to the
< assembler file. */
---
> /* X must not be a pseudo reg. */
> gcc_assert (!x || !REG_P (x) || REGNO (x) < FIRST_PSEUDO_REGISTER);
3142,3144d3173
< if (x && GET_CODE (x) == REG && REGNO (x) >= FIRST_PSEUDO_REGISTER)
< abort ();
<
3175a3205,3206
> if (SYMBOL_REF_DECL (x))
> mark_decl_referenced (SYMBOL_REF_DECL (x));
3440c3471
< abort ();
---
> gcc_unreachable ();
3587,3588c3618,3619
< *first = GEN_INT ((HOST_WIDE_INT) l[0]);
< *second = GEN_INT ((HOST_WIDE_INT) l[1]);
---
> *first = GEN_INT (l[0]);
> *second = GEN_INT (l[1]);
3605c3636
< if (GET_CODE (insn) == CALL_INSN
---
> if (CALL_P (insn)
3608c3639
< if (GET_CODE (insn) == INSN
---
> if (NONJUMP_INSN_P (insn)
3610c3641
< && GET_CODE (XVECEXP (PATTERN (insn), 0, 0)) == CALL_INSN
---
> && CALL_P (XVECEXP (PATTERN (insn), 0, 0))
3620c3651
< if (GET_CODE (insn) == CALL_INSN
---
> if (CALL_P (insn)
3623c3654
< if (GET_CODE (insn) == INSN
---
> if (NONJUMP_INSN_P (insn)
3625c3656
< && GET_CODE (XVECEXP (PATTERN (insn), 0, 0)) == CALL_INSN
---
> && CALL_P (XVECEXP (PATTERN (insn), 0, 0))
3641,3642c3672,3673
< if (!uid_shuid)
< abort ();
---
>
> gcc_assert (uid_shuid);
3646,3647c3677
< if (!insn_id || !label_id)
< abort ();
---
> gcc_assert (insn_id && label_id);
3678c3708
< && GET_CODE (pic_offset_table_rtx) == REG
---
> && REG_P (pic_offset_table_rtx)
3722c3752
< if (GET_CODE (in_rtx) == REG)
---
> if (REG_P (in_rtx))
3739,3740c3769
< if (newreg < 0)
< abort ();
---
> gcc_assert (newreg >= 0);
3783c3812
< abort ();
---
> gcc_unreachable ();
3819c3848
< /* If we pushed queued symbols then such symbols are must be
---
> /* If we pushed queued symbols then such symbols must be
3868a3898,4086
>
> /* Turn the RTL into assembly. */
> static unsigned int
> rest_of_handle_final (void)
> {
> rtx x;
> const char *fnname;
>
> /* Get the function's name, as described by its RTL. This may be
> different from the DECL_NAME name used in the source file. */
>
> x = DECL_RTL (current_function_decl);
> gcc_assert (MEM_P (x));
> x = XEXP (x, 0);
> gcc_assert (GET_CODE (x) == SYMBOL_REF);
> fnname = XSTR (x, 0);
>
> assemble_start_function (current_function_decl, fnname);
> final_start_function (get_insns (), asm_out_file, optimize);
> final (get_insns (), asm_out_file, optimize);
> final_end_function ();
>
> #ifdef TARGET_UNWIND_INFO
> /* ??? The IA-64 ".handlerdata" directive must be issued before
> the ".endp" directive that closes the procedure descriptor. */
> output_function_exception_table ();
> #endif
>
> assemble_end_function (current_function_decl, fnname);
>
> #ifndef TARGET_UNWIND_INFO
> /* Otherwise, it feels unclean to switch sections in the middle. */
> output_function_exception_table ();
> #endif
>
> user_defined_section_attribute = false;
>
> if (! quiet_flag)
> fflush (asm_out_file);
>
> /* Release all memory allocated by flow. */
> free_basic_block_vars ();
>
> /* Write DBX symbols if requested. */
>
> /* Note that for those inline functions where we don't initially
> know for certain that we will be generating an out-of-line copy,
> the first invocation of this routine (rest_of_compilation) will
> skip over this code by doing a `goto exit_rest_of_compilation;'.
> Later on, wrapup_global_declarations will (indirectly) call
> rest_of_compilation again for those inline functions that need
> to have out-of-line copies generated. During that call, we
> *will* be routed past here. */
>
> timevar_push (TV_SYMOUT);
> (*debug_hooks->function_decl) (current_function_decl);
> timevar_pop (TV_SYMOUT);
> return 0;
> }
>
> struct tree_opt_pass pass_final =
> {
> NULL, /* name */
> NULL, /* gate */
> rest_of_handle_final, /* execute */
> NULL, /* sub */
> NULL, /* next */
> 0, /* static_pass_number */
> TV_FINAL, /* tv_id */
> 0, /* properties_required */
> 0, /* properties_provided */
> 0, /* properties_destroyed */
> 0, /* todo_flags_start */
> TODO_ggc_collect, /* todo_flags_finish */
> 0 /* letter */
> };
>
>
> static unsigned int
> rest_of_handle_shorten_branches (void)
> {
> /* Shorten branches. */
> shorten_branches (get_insns ());
> return 0;
> }
>
> struct tree_opt_pass pass_shorten_branches =
> {
> "shorten", /* name */
> NULL, /* gate */
> rest_of_handle_shorten_branches, /* execute */
> NULL, /* sub */
> NULL, /* next */
> 0, /* static_pass_number */
> TV_FINAL, /* tv_id */
> 0, /* properties_required */
> 0, /* properties_provided */
> 0, /* properties_destroyed */
> 0, /* todo_flags_start */
> TODO_dump_func, /* todo_flags_finish */
> 0 /* letter */
> };
>
>
> static unsigned int
> rest_of_clean_state (void)
> {
> rtx insn, next;
>
> /* It is very important to decompose the RTL instruction chain here:
> debug information keeps pointing into CODE_LABEL insns inside the function
> body. If these remain pointing to the other insns, we end up preserving
> whole RTL chain and attached detailed debug info in memory. */
> for (insn = get_insns (); insn; insn = next)
> {
> next = NEXT_INSN (insn);
> NEXT_INSN (insn) = NULL;
> PREV_INSN (insn) = NULL;
> }
>
> /* In case the function was not output,
> don't leave any temporary anonymous types
> queued up for sdb output. */
> #ifdef SDB_DEBUGGING_INFO
> if (write_symbols == SDB_DEBUG)
> sdbout_types (NULL_TREE);
> #endif
>
> reload_completed = 0;
> epilogue_completed = 0;
> flow2_completed = 0;
> no_new_pseudos = 0;
> #ifdef STACK_REGS
> regstack_completed = 0;
> #endif
>
> /* Clear out the insn_length contents now that they are no
> longer valid. */
> init_insn_lengths ();
>
> /* Show no temporary slots allocated. */
> init_temp_slots ();
>
> free_basic_block_vars ();
> free_bb_for_insn ();
>
>
> if (targetm.binds_local_p (current_function_decl))
> {
> int pref = cfun->preferred_stack_boundary;
> if (cfun->stack_alignment_needed > cfun->preferred_stack_boundary)
> pref = cfun->stack_alignment_needed;
> cgraph_rtl_info (current_function_decl)->preferred_incoming_stack_boundary
> = pref;
> }
>
> /* Make sure volatile mem refs aren't considered valid operands for
> arithmetic insns. We must call this here if this is a nested inline
> function, since the above code leaves us in the init_recog state,
> and the function context push/pop code does not save/restore volatile_ok.
>
> ??? Maybe it isn't necessary for expand_start_function to call this
> anymore if we do it here? */
>
> init_recog_no_volatile ();
>
> /* We're done with this function. Free up memory if we can. */
> free_after_parsing (cfun);
> free_after_compilation (cfun);
> return 0;
> }
>
> struct tree_opt_pass pass_clean_state =
> {
> NULL, /* name */
> NULL, /* gate */
> rest_of_clean_state, /* execute */
> NULL, /* sub */
> NULL, /* next */
> 0, /* static_pass_number */
> TV_FINAL, /* tv_id */
> 0, /* properties_required */
> 0, /* properties_provided */
> PROP_rtl, /* properties_destroyed */
> 0, /* todo_flags_start */
> 0, /* todo_flags_finish */
> 0 /* letter */
> };
>