]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/31081 (Inliner messes up SSA for abnormals)
authorRichard Guenther <rguenther@suse.de>
Fri, 4 Jan 2008 11:16:17 +0000 (11:16 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 4 Jan 2008 11:16:17 +0000 (11:16 +0000)
2008-01-04  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/31081
* g++.dg/torture/pr31081-1.C: New testcase.
* g++.dg/torture/pr31081-2.C: Likewise.

From-SVN: r131320

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/torture/pr31081-1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/torture/pr31081-2.C [new file with mode: 0644]

index c027dbae2f814535a44361d6a3b6544ae1532c58..5cbb424e0c01cbd06bf371d0cf078f665ebcfae1 100644 (file)
@@ -1,3 +1,9 @@
+2008-01-04  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/31081
+       * g++.dg/torture/pr31081-1.C: New testcase.
+       * g++.dg/torture/pr31081-2.C: Likewise.
+
 2008-01-04  Richard Sandiford  <rsandifo@nildram.co.uk>
 
        * gcc.target/mips/rsqrt-1.c: Require -mgp64.
diff --git a/gcc/testsuite/g++.dg/torture/pr31081-1.C b/gcc/testsuite/g++.dg/torture/pr31081-1.C
new file mode 100644 (file)
index 0000000..cb11b21
--- /dev/null
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+
+static int get_record (void);
+void f(void);
+int g(void);
+static int get_record (void)
+{
+  int     result;
+  try
+  {
+    result = g();
+    f();
+  }
+  catch (const int &)   { }
+  return result;
+}
+int NAV_get_record ( )
+{
+  int     result;
+  for (;;)
+    if (get_record ())
+      return 1;
+}
diff --git a/gcc/testsuite/g++.dg/torture/pr31081-2.C b/gcc/testsuite/g++.dg/torture/pr31081-2.C
new file mode 100644 (file)
index 0000000..a14ef37
--- /dev/null
@@ -0,0 +1,48 @@
+/* { dg-do compile } */
+
+class CString
+{
+public:
+    CString();
+    ~CString() { operator delete(_rep); }
+    operator const char*() const { return _rep; }
+private:
+    CString(char* cstr);
+    char* _rep;
+};
+
+class String
+{
+public:
+
+    String();
+    String(const char* str);
+    ~String();
+    CString getCString() const;
+};
+
+int is_absolute_path(const char *path);
+
+inline void getAbsolutePath(
+    const char* path,
+    const String& filename)
+{
+    (!is_absolute_path(filename.getCString()) && path);
+    return;
+}
+
+int foo(int &value);
+
+int main(int argc, char** argv)
+{
+    int repeatTestCount = 0;
+    if (foo(repeatTestCount))
+    {
+        repeatTestCount = 1;
+    }
+    for (int numTests = 1; numTests <= repeatTestCount; numTests++)
+    {
+            getAbsolutePath("blah", "blah");
+    }
+    return 0;
+}