re PR rtl-optimization/17078 (Jump into if(0)-substatement fails)
authorRoger Sayle <roger@eyesopen.com>
Tue, 24 Aug 2004 04:23:31 +0000 (04:23 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Tue, 24 Aug 2004 04:23:31 +0000 (04:23 +0000)
PR rtl-optimization/17078
* gcc.c-torture/execute/pr17078-1.c: New test case.

From-SVN: r86463

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/pr17078-1.c [new file with mode: 0644]

index 5c688632e9e61bc5b934be19139438ef449c4686..38b1d24b7ebe46bbd516f0d7a48570945d81ea88 100644 (file)
@@ -1,3 +1,8 @@
+2004-08-23  Roger Sayle  <roger@eyesopen.com>
+
+       PR rtl-optimization/17078
+       * gcc.c-torture/execute/pr17078-1.c: New test case.
+
 2004-08-23  Mark Mitchell  <mark@codesourcery.com>
 
        PR c/14492
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr17078-1.c b/gcc/testsuite/gcc.c-torture/execute/pr17078-1.c
new file mode 100644 (file)
index 0000000..9380bf4
--- /dev/null
@@ -0,0 +1,25 @@
+extern void abort(void);
+
+void test(int *ptr)
+{
+  int i = 1;
+  goto useless;
+  if (0)
+    {
+      useless:
+      i = 0;
+    }
+  else
+    i = 1;
+  *ptr = i;
+}
+
+int main()
+{
+  int i = 1;
+  test(&i);
+  if (i)
+    abort ();
+  return 0;
+}
+