aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey A Law <law@cygnus.com>1998-04-08 22:47:50 +0000
committerJeff Law <law@gcc.gnu.org>1998-04-08 16:47:50 -0600
commite105f02cd831e95c009d62f991e7d856e8d5f135 (patch)
tree33a577756412bbaae8dd6d3143b77ad81c0b81e4
parent56b2d7a733259e7a0a33bd8591a5200d1f416b86 (diff)
downloadgcc-e105f02cd831e95c009d62f991e7d856e8d5f135.zip
gcc-e105f02cd831e95c009d62f991e7d856e8d5f135.tar.gz
gcc-e105f02cd831e95c009d62f991e7d856e8d5f135.tar.bz2
jump.c (mark_jump_label): Record REG_LABEL notes for insns which refer to the CODE_LABEL before a...
* jump.c (mark_jump_label): Record REG_LABEL notes for insns which refer to the CODE_LABEL before a dispatch table. From-SVN: r19060
-rw-r--r--gcc/ChangeLog3
-rw-r--r--gcc/jump.c26
2 files changed, 18 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2207362..6462e6e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -23,6 +23,9 @@ Fri Apr 3 17:02:13 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
Wed Apr 8 12:51:19 1998 Jeffrey A Law (law@cygnus.com)
+ * jump.c (mark_jump_label): Record REG_LABEL notes for insns which
+ refer to the CODE_LABEL before a dispatch table.
+
* invoke.texi: Add ARC options.
* gcc.c (proces_command): Improve error message for -o with
diff --git a/gcc/jump.c b/gcc/jump.c
index e0d20a6..ef80eb6 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -3397,17 +3397,21 @@ mark_jump_label (x, insn, cross_jump)
is one. */
else if (! find_reg_note (insn, REG_LABEL, label))
{
- rtx next = next_real_insn (label);
- /* Don't record labels that refer to dispatch tables.
- This is not necessary, since the tablejump
- references the same label.
- And if we did record them, flow.c would make worse code. */
- if (next == 0
- || ! (GET_CODE (next) == JUMP_INSN
- && (GET_CODE (PATTERN (next)) == ADDR_VEC
- || GET_CODE (PATTERN (next)) == ADDR_DIFF_VEC)))
- REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_LABEL, label,
- REG_NOTES (insn));
+ /* This code used to ignore labels which refered to dispatch
+ tables to avoid flow.c generating worse code.
+
+ However, in the presense of global optimizations like
+ gcse which call find_basic_blocks without calling
+ life_analysis, not recording such labels will lead
+ to compiler aborts because of inconsistencies in the
+ flow graph. So we go ahead and record the label.
+
+ It may also be the case that the optimization argument
+ is no longer valid because of the more accurate cfg
+ we build in find_basic_blocks -- it no longer pessimizes
+ code when it finds a REG_LABEL note. */
+ REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_LABEL, label,
+ REG_NOTES (insn));
}
}
return;