OSDN Git Service

PR tree-optimization/46864
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 10 Dec 2010 12:42:12 +0000 (12:42 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 10 Dec 2010 12:42:12 +0000 (12:42 +0000)
* tree-ssa-loop-im.c (loop_suitable_for_sm): Return false even
when there are EDGE_EH exit edges.

* g++.dg/opt/pr46864.C: New test.

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

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/opt/pr46864.C [new file with mode: 0644]
gcc/tree-ssa-loop-im.c

index fb6bbc8..ed331ad 100644 (file)
@@ -1,3 +1,9 @@
+2010-12-10  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/46864
+       * tree-ssa-loop-im.c (loop_suitable_for_sm): Return false even
+       when there are EDGE_EH exit edges.
+
 2010-12-10  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/46540
index b2978f0..63a3a48 100644 (file)
@@ -1,3 +1,8 @@
+2010-12-10  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/46864
+       * g++.dg/opt/pr46864.C: New test.
+
 2010-12-10  Jack Howarth  <howarth@bromo.med.uc.edu>
            Iain Sandoe  <iains@gcc.gnu.org>
 
diff --git a/gcc/testsuite/g++.dg/opt/pr46864.C b/gcc/testsuite/g++.dg/opt/pr46864.C
new file mode 100644 (file)
index 0000000..0f7b7d2
--- /dev/null
@@ -0,0 +1,26 @@
+// PR tree-optimization/46864
+// { dg-do compile }
+// { dg-options "-O -fnon-call-exceptions" }
+
+int baz ();
+
+struct S
+{
+  int k;
+  bool bar () throw ()
+  {
+    int m = baz ();
+    for (int i = 0; i < m; i++)
+      k = i;
+    return m;
+  }
+};
+
+extern S *s;
+
+void
+foo ()
+{
+  while (baz () && s->bar ())
+    ;
+}
index 45902e5..30faeb9 100644 (file)
@@ -2369,7 +2369,7 @@ loop_suitable_for_sm (struct loop *loop ATTRIBUTE_UNUSED,
   edge ex;
 
   FOR_EACH_VEC_ELT (edge, exits, i, ex)
-    if (ex->flags & EDGE_ABNORMAL)
+    if (ex->flags & (EDGE_ABNORMAL | EDGE_EH))
       return false;
 
   return true;