diff options
author | Jakub Jelinek <jakub@redhat.com> | 2005-03-22 14:29:29 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2005-03-22 14:29:29 +0100 |
commit | b2a6a2fb642ff3deaf4ac102ebca75e96ed9d1e9 (patch) | |
tree | 27cfa1f3413445ef3163b5d474ce0e9ab308b803 /gcc/final.c | |
parent | 37048601f7fed81a6cef3dd46dac2280b855b53c (diff) | |
download | gcc-b2a6a2fb642ff3deaf4ac102ebca75e96ed9d1e9.zip gcc-b2a6a2fb642ff3deaf4ac102ebca75e96ed9d1e9.tar.gz gcc-b2a6a2fb642ff3deaf4ac102ebca75e96ed9d1e9.tar.bz2 |
re PR target/20561 (Error compiling jdtcore.jar on powerpc)
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.
From-SVN: r96867
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 bf5771a..9347efe 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; |