aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2010-11-17 14:02:31 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2010-11-17 14:02:31 +0100
commit073d7052e568286ab54cf68583340cf0c1d70ebe (patch)
tree1e89d1229ecf0cb5ad8729761520910b3d4127b2 /gcc
parentf79616a446e17b2e69769a57939cf9b1c65064f2 (diff)
downloadgcc-073d7052e568286ab54cf68583340cf0c1d70ebe.zip
gcc-073d7052e568286ab54cf68583340cf0c1d70ebe.tar.gz
gcc-073d7052e568286ab54cf68583340cf0c1d70ebe.tar.bz2
re PR rtl-optimization/46440 (ICE: in rtl_verify_flow_info, at cfgrtl.c:2165 with -fstack-protector-all -fno-tree-dominator-opts -fno-tree-fre)
PR rtl-optimization/46440 * combine.c (update_cfg_for_uncondjump): When changing an indirect jump into unconditional jump, remove BARRIERs from bb's footer. * gcc.dg/pr46440.c: New test. From-SVN: r166867
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/combine.c20
-rw-r--r--gcc/testsuite/ChangeLog3
-rw-r--r--gcc/testsuite/gcc.dg/pr46440.c25
4 files changed, 54 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a131549..3fa0b56 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2010-11-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/46440
+ * combine.c (update_cfg_for_uncondjump): When changing
+ an indirect jump into unconditional jump, remove BARRIERs
+ from bb's footer.
+
2010-11-17 Joseph Myers <joseph@codesourcery.com>
* opts.c (target_handle_option): Do not assert that loc ==
diff --git a/gcc/combine.c b/gcc/combine.c
index d55ce31..c557e8c 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -2460,7 +2460,25 @@ update_cfg_for_uncondjump (rtx insn)
delete_insn (insn);
if (at_end && EDGE_COUNT (bb->succs) == 1)
- single_succ_edge (bb)->flags |= EDGE_FALLTHRU;
+ {
+ rtx insn;
+
+ single_succ_edge (bb)->flags |= EDGE_FALLTHRU;
+
+ /* Remove barriers from the footer if there are any. */
+ for (insn = bb->il.rtl->footer; insn; insn = NEXT_INSN (insn))
+ if (BARRIER_P (insn))
+ {
+ if (PREV_INSN (insn))
+ NEXT_INSN (PREV_INSN (insn)) = NEXT_INSN (insn);
+ else
+ bb->il.rtl->footer = NEXT_INSN (insn);
+ if (NEXT_INSN (insn))
+ PREV_INSN (NEXT_INSN (insn)) = PREV_INSN (insn);
+ }
+ else if (LABEL_P (insn))
+ break;
+ }
}
/* Try to combine the insns I0, I1 and I2 into I3.
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 3f2958c..4c94254 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,8 @@
2010-11-17 Jakub Jelinek <jakub@redhat.com>
+ PR rtl-optimization/46440
+ * gcc.dg/pr46440.c: New test.
+
PR testsuite/45429
* gcc.dg/vect/no-section-anchors-vect-64.c: New test.
diff --git a/gcc/testsuite/gcc.dg/pr46440.c b/gcc/testsuite/gcc.dg/pr46440.c
new file mode 100644
index 0000000..12a9997
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr46440.c
@@ -0,0 +1,25 @@
+/* PR rtl-optimization/46440 */
+/* { dg-do compile } */
+/* { dg-options "-O -fstack-protector -fno-tree-dominator-opts -fno-tree-fre" } */
+/* { dg-require-effective-target fstack_protector } */
+
+int i;
+
+void bar (char *);
+
+void
+foo (void)
+{
+ void *l;
+ char c[64];
+ bar (c);
+ i = 1;
+ if (i)
+ l = &&l1;
+ else
+ l = &&l2;
+ goto *l;
+l2:
+ __builtin_abort ();
+l1:;
+}