OSDN Git Service

PR tree-optimization/44539
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 25 Jun 2010 12:07:00 +0000 (12:07 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 25 Jun 2010 12:07:00 +0000 (12:07 +0000)
* tree-cfgcleanup.c (fixup_noreturn_call): Call update_stmt even when
the call doesn't have LHS, but has VDEF.

* gcc.dg/pr44539.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161374 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr44539.c [new file with mode: 0644]
gcc/tree-cfgcleanup.c

index d56312a..64c82e2 100644 (file)
@@ -1,3 +1,9 @@
+2010-06-25  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/44539
+       * tree-cfgcleanup.c (fixup_noreturn_call): Call update_stmt even when
+       the call doesn't have LHS, but has VDEF.
+
 2010-06-25  Joseph Myers  <joseph@codesourcery.com>
 
        * config/pa/pa.h (MODIFY_TARGET_NAME): Remove.
index 9a397e2..55b8019 100644 (file)
@@ -1,3 +1,8 @@
+2010-06-25  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/44539
+       * gcc.dg/pr44539.c: New test.
+
 2010-06-25  Bernd Schmidt  <bernds@codesourcery.com>
 
        From Jim Wilson:
diff --git a/gcc/testsuite/gcc.dg/pr44539.c b/gcc/testsuite/gcc.dg/pr44539.c
new file mode 100644 (file)
index 0000000..9cfff7a
--- /dev/null
@@ -0,0 +1,29 @@
+/* PR tree-optimization/44539 */
+/* { dg-do compile } */
+/* { dg-options "-ftracer -freorder-blocks -O2" } */
+
+void bar (int file);
+extern int baz (void);
+
+void noret1 ()
+{
+  bar (0);
+  __builtin_exit (0);
+}
+
+void noret2 ()
+{
+  __builtin_exit (0);
+}
+
+void bar (int i)
+{
+  if (baz ())
+    noret1 (i);
+}
+
+void foo (int i)
+{
+  if (~i) bar (i);
+  i ? noret1 () : noret2 ();
+}
index 7e78174..7f8498a 100644 (file)
@@ -591,6 +591,9 @@ fixup_noreturn_call (gimple stmt)
       update_stmt (stmt);
       changed = true;
     }
+  /* Similarly remove VDEF if there is any.  */
+  else if (gimple_vdef (stmt))
+    update_stmt (stmt);
   return changed;
 }