OSDN Git Service

2010-10-01 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 1 Oct 2010 12:07:47 +0000 (12:07 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 1 Oct 2010 12:07:47 +0000 (12:07 +0000)
PR tree-optimization/45854
* tree-eh.c (cleanup_empty_eh): Avoid degenerate case.

* g++.dg/torture/pr45854.C: New testcase.

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

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/torture/pr45854.C [new file with mode: 0644]
gcc/tree-eh.c

index e1deab0..bb7a98b 100644 (file)
@@ -1,3 +1,8 @@
+2010-10-01  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/45854
+       * tree-eh.c (cleanup_empty_eh): Avoid degenerate case.
+
 2010-10-01  Anthony Green  <green@moxielogic.com>
 
        * config.gcc: Fix moxie-*-rtems* configuration.
index eecc6be..5af0697 100644 (file)
@@ -1,3 +1,8 @@
+2010-10-01  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/45854
+       * g++.dg/torture/pr45854.C: New testcase.
+
 2010-09-30  Michael Eager  <eager@eagercon.com>
 
        * gcc.c-torture/execute/cmpsf-1.c: Rename FLOAT_{MIN,MAX} to
diff --git a/gcc/testsuite/g++.dg/torture/pr45854.C b/gcc/testsuite/g++.dg/torture/pr45854.C
new file mode 100644 (file)
index 0000000..17ee006
--- /dev/null
@@ -0,0 +1,30 @@
+// { dg-do compile }
+
+template < typename = void >
+struct X { } ;
+struct Y
+{
+  Y () ;
+} ;
+template < typename = X < > >
+struct T
+{
+  void f ()
+    {
+      f () ;
+    }
+} ;
+struct S
+{
+  S ( X < > = X < > ()) ;
+  ~S ()
+    {
+      T < > () . f () ;
+    }
+} ;
+struct Z
+{
+  S s ;
+  Y y ;
+} a ;
+
index 2174276..8a99ad3 100644 (file)
@@ -3743,7 +3743,13 @@ cleanup_empty_eh (eh_landing_pad lp)
 
   /* If the block is totally empty, look for more unsplitting cases.  */
   if (gsi_end_p (gsi))
-    return cleanup_empty_eh_unsplit (bb, e_out, lp);
+    {
+      /* For the degenerate case of an infinite loop bail out.  */
+      if (e_out->dest == bb)
+       return false;
+
+      return cleanup_empty_eh_unsplit (bb, e_out, lp);
+    }
 
   /* The block should consist only of a single RESX statement.  */
   resx = gsi_stmt (gsi);