diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-03-22 13:29:29 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-03-22 13:29:29 +0000 |
commit | 8476db153df7258b9f6680cca7d1acf5e882b2cf (patch) | |
tree | 27cfa1f3413445ef3163b5d474ce0e9ab308b803 /gcc/final.c | |
parent | 5760bc87a232935506fc4d4d05bb1631008d6a7c (diff) | |
download | ppe42-gcc-8476db153df7258b9f6680cca7d1acf5e882b2cf.tar.gz ppe42-gcc-8476db153df7258b9f6680cca7d1acf5e882b2cf.zip |
PR target/20561
* cfglayout.c (reemit_insn_block_notes): Don't put block notes in
between jump table and its label.
* final.c (shorten_branches): Handle notes in between ADDR_VEC
resp. ADDR_DIFF_VEC and the label preceeding it.
(final_scan_insn): Likewise. Ensure ADDR_VEC resp. ADDR_DIFF_VEC
is emitted in the right section.
* gcc.dg/20050321-2.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96867 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/final.c')
-rw-r--r-- | gcc/final.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/gcc/final.c b/gcc/final.c index bf5771aebfb..9347efe6b47 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -835,7 +835,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) @@ -1677,6 +1677,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, #ifdef HAVE_cc0 rtx set; #endif + rtx next; insn_counter++; @@ -1932,10 +1933,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 +1958,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 +1969,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 +2024,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 +2164,6 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, { /* A delayed-branch sequence */ int i; - rtx next; if (prescan > 0) break; |