aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2010-11-23 16:16:43 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2010-11-23 16:16:43 +0100
commit90eb3e33b896f57ec061b2404eab6de9e984d7a2 (patch)
tree95d45f0b7a3cd58a3cc14a87016b385e22d8eeaf /gcc
parentae8358d69a0f237f466185b41396bb735793b460 (diff)
downloadgcc-90eb3e33b896f57ec061b2404eab6de9e984d7a2.zip
gcc-90eb3e33b896f57ec061b2404eab6de9e984d7a2.tar.gz
gcc-90eb3e33b896f57ec061b2404eab6de9e984d7a2.tar.bz2
re PR middle-end/46499 (gcc.c-torture/execute/20051021-1.c FAILs with -fno-tree-dominator-opts -fno-tree-ccp)
PR middle-end/46499 * cfgexpand.c (maybe_cleanup_end_of_block): Remove also BARRIERs following unconditional jumps. * gcc.dg/pr46499-1.c: New test. * gcc.dg/pr46499-2.c: New test. From-SVN: r167082
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/cfgexpand.c9
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gcc.dg/pr46499-1.c31
-rw-r--r--gcc/testsuite/gcc.dg/pr46499-2.c19
5 files changed, 70 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9fcd937..d0bf047 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2010-11-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/46499
+ * cfgexpand.c (maybe_cleanup_end_of_block): Remove also BARRIERs
+ following unconditional jumps.
+
2010-11-23 Richard Guenther <rguenther@suse.de>
* doc/md.texi (386 constraints): Clarify A constraint documentation.
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 784639d..a65f12b 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -1694,7 +1694,14 @@ maybe_cleanup_end_of_block (edge e, rtx last)
{
insn = PREV_INSN (insn);
if (JUMP_P (NEXT_INSN (insn)))
- delete_insn (NEXT_INSN (insn));
+ {
+ if (!any_condjump_p (insn))
+ {
+ gcc_assert (BARRIER_P (NEXT_INSN (NEXT_INSN (insn))));
+ delete_insn (NEXT_INSN (NEXT_INSN (insn)));
+ }
+ delete_insn (NEXT_INSN (insn));
+ }
}
}
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index f8542e4..72ea1c5 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2010-11-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/46499
+ * gcc.dg/pr46499-1.c: New test.
+ * gcc.dg/pr46499-2.c: New test.
+
2010-11-23 Jack Howarth <howarth@bromo.med.uc.edu>
* gcc.target/i386/alias-1.c: Require alias support.
diff --git a/gcc/testsuite/gcc.dg/pr46499-1.c b/gcc/testsuite/gcc.dg/pr46499-1.c
new file mode 100644
index 0000000..9815272
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr46499-1.c
@@ -0,0 +1,31 @@
+/* PR middle-end/46499 */
+/* { dg-do run } */
+/* { dg-options "-O -fno-omit-frame-pointer -fno-tree-ccp -fno-tree-dominator-opts -finline-small-functions" } */
+
+extern void abort (void);
+
+int count = 0;
+
+int
+foo (void)
+{
+ count++;
+ return 0;
+}
+
+int
+bar (void)
+{
+ count++;
+ return 0;
+}
+
+int
+main ()
+{
+ if ((foo () == 1) & (bar () == 1))
+ abort ();
+ if (count != 2)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/pr46499-2.c b/gcc/testsuite/gcc.dg/pr46499-2.c
new file mode 100644
index 0000000..c3a2648
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr46499-2.c
@@ -0,0 +1,19 @@
+/* PR middle-end/46499 */
+/* { dg-do compile } */
+/* { dg-options "-O -fno-tree-ccp -fno-tree-dominator-opts" } */
+
+extern void abort (void);
+
+static inline int
+foo (void)
+{
+ return 0;
+}
+
+int
+main ()
+{
+ if ((foo () == 1) & (foo () == 1))
+ abort ();
+ return 0;
+}