X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Ffinal.c;h=e1c01483c5f875f89ae79d069d3672bd98ba0fa4;hb=792005aed55b765a042ebd74a538c4e9447f099a;hp=abc07c50c8e81e7e9136030468d3dd719ae6bcff;hpb=1e9d55d7578c83f6b7a857c3b76fb7d00de83cbc;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/final.c b/gcc/final.c index abc07c50c8e..e1c01483c5f 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -200,6 +200,10 @@ static int app_on; rtx final_sequence; +/* True if we are outputting insns in a delay slot. This is used + to prettify the assembly. */ +static bool output_in_slot; + #ifdef ASSEMBLER_DIALECT /* Number of the assembler dialect to use, starting at 0. */ @@ -1663,8 +1667,11 @@ scan_ahead_for_unlikely_executed_note (rtx insn) is the insn being scanned. Value returned is the next insn to be scanned. - NOPEEPHOLES is the flag to disallow peephole processing (currently - used for within delayed branch sequence output). + NOPEEPHOLES is used to disallow peephole processing: + - 0: peepholes are allowed, + - 1: peepholes are not allowed, + - 2: peepholes are not allowed and we are in the + slot of a delayed branch. SEEN is used to track the end of the prologue, for emitting debug information. We force the emission of a line note after @@ -1674,8 +1681,7 @@ scan_ahead_for_unlikely_executed_note (rtx insn) rtx final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, - int prescan, int nopeepholes ATTRIBUTE_UNUSED, - int *seen) + int prescan, int nopeepholes, int *seen) { #ifdef HAVE_cc0 rtx set; @@ -1699,9 +1705,6 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, case NOTE_INSN_DELETED: 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: case NOTE_INSN_FUNCTION_END: case NOTE_INSN_REPEATED_LINE_NUMBER: case NOTE_INSN_EXPECTED_VALUE: @@ -1728,9 +1731,8 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, are writing to appropriately. */ if (flag_reorder_blocks_and_partition - && in_unlikely_text_section() && !scan_ahead_for_unlikely_executed_note (insn)) - text_section (); + function_section (current_function_decl); #ifdef TARGET_UNWIND_INFO targetm.asm_out.unwind_emit (asm_out_file, insn); @@ -1795,7 +1797,6 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, case NOTE_INSN_BLOCK_BEG: if (debug_info_level == DINFO_LEVEL_NORMAL || debug_info_level == DINFO_LEVEL_VERBOSE - || write_symbols == DWARF_DEBUG || write_symbols == DWARF2_DEBUG || write_symbols == VMS_AND_DWARF2_DEBUG || write_symbols == VMS_DEBUG) @@ -1817,7 +1818,6 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, case NOTE_INSN_BLOCK_END: if (debug_info_level == DINFO_LEVEL_NORMAL || debug_info_level == DINFO_LEVEL_VERBOSE - || write_symbols == DWARF_DEBUG || write_symbols == DWARF2_DEBUG || write_symbols == VMS_AND_DWARF2_DEBUG || write_symbols == VMS_DEBUG) @@ -1923,7 +1923,8 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, basic blocks into separate sections of the .o file, we need to ensure the jump table ends up in the correct section... */ - if (flag_reorder_blocks_and_partition) + if (flag_reorder_blocks_and_partition + && targetm.have_named_sections) { rtx tmp_table, tmp_label; if (LABEL_P (insn) @@ -1933,11 +1934,8 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, } else if (scan_ahead_for_unlikely_executed_note (insn)) unlikely_text_section (); - else - { - if (in_unlikely_text_section ()) - text_section (); - } + else if (in_unlikely_text_section ()) + function_section (current_function_decl); } if (app_on) @@ -1966,7 +1964,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, { int log_align; - readonly_data_section (); + targetm.asm_out.function_rodata_section (current_function_decl); #ifdef ADDR_VEC_ALIGN log_align = ADDR_VEC_ALIGN (NEXT_INSN (insn)); @@ -2203,7 +2201,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, /* We loop in case any instruction in a delay slot gets split. */ do - insn = final_scan_insn (insn, file, 0, prescan, 1, seen); + insn = final_scan_insn (insn, file, 0, prescan, 2, seen); while (insn != next); } #ifdef DBR_OUTPUT_SEQEND @@ -2535,7 +2533,9 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, #endif /* Output assembler code from the template. */ + output_in_slot = (nopeepholes > 1); output_asm_insn (template, recog_data.operand); + output_in_slot = false; /* If necessary, report the effect that the instruction has on the unwind info. We've already done this for delay slots @@ -2996,6 +2996,8 @@ output_asm_insn (const char *template, rtx *operands) memset (opoutput, 0, sizeof opoutput); p = template; putc ('\t', asm_out_file); + if (output_in_slot) + putc (' ', asm_out_file); #ifdef ASM_OUTPUT_OPCODE ASM_OUTPUT_OPCODE (asm_out_file, p);