]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR middle-end/46629 (Failed to build 200.sixtrack in SPEC CPU 2000)
authorJakub Jelinek <jakub@redhat.com>
Tue, 7 Dec 2010 15:23:15 +0000 (16:23 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 7 Dec 2010 15:23:15 +0000 (16:23 +0100)
Backport from mainline
2010-11-24  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/46629
* cfgexpand.c (maybe_cleanup_end_of_block): Test NEXT_INSN (insn)
instead of insn with any_condjump_p.

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.

* gcc.dg/pr46499-1.c: New test.
* gcc.dg/pr46499-2.c: New test.

From-SVN: r167545

gcc/ChangeLog
gcc/cfgexpand.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr46499-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/pr46499-2.c [new file with mode: 0644]

index 3d73e3f32248d75c339a6fc5b954e04fd3ac92fe..c48faac196a8db9fba7000564e3d3ca8ba546834 100644 (file)
@@ -1,3 +1,18 @@
+2010-12-07  Jakub Jelinek  <jakub@redhat.com>
+
+       Backport from mainline
+       2010-11-24  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/46629
+       * cfgexpand.c (maybe_cleanup_end_of_block): Test NEXT_INSN (insn)
+       instead of insn with any_condjump_p.
+
+       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-12-07  Sebastian Pop  <sebastian.pop@amd.com>
 
        Backport from mainline:
index 69c3f5f56ee19c9f10146a3a9b9a839c8952943e..751bcd41c9e0d13ca8ea625556d07bf2cdd941e6 100644 (file)
@@ -1573,7 +1573,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 (NEXT_INSN (insn)))
+               {
+                 gcc_assert (BARRIER_P (NEXT_INSN (NEXT_INSN (insn))));
+                 delete_insn (NEXT_INSN (NEXT_INSN (insn)));
+               }
+             delete_insn (NEXT_INSN (insn));
+           }
        }
     }
 }
index d1a901c800749a24d773a883ead4362079607e78..297cc14d29dc1d2503b4673073d342bb7f218922 100644 (file)
@@ -1,6 +1,12 @@
 2010-12-07  Jakub Jelinek  <jakub@redhat.com>
 
        Backport from mainline
+       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-20  Jakub Jelinek  <jakub@redhat.com>
  
        PR c++/46538
diff --git a/gcc/testsuite/gcc.dg/pr46499-1.c b/gcc/testsuite/gcc.dg/pr46499-1.c
new file mode 100644 (file)
index 0000000..9815272
--- /dev/null
@@ -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 (file)
index 0000000..c3a2648
--- /dev/null
@@ -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;
+}