2014-05-07 Richard Biener <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 7 May 2014 08:04:15 +0000 (08:04 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 7 May 2014 08:04:15 +0000 (08:04 +0000)
PR tree-optimization/57864
* gcc.dg/torture/pr57864.c: New testcase.

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

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr57864.c [new file with mode: 0644]

index 38bb9e2..c7a1b05 100644 (file)
@@ -1,3 +1,8 @@
+2014-05-07  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/57864
+       * gcc.dg/torture/pr57864.c: New testcase.
+
 2014-05-06  Jerry DeLisle  <jvdelisle@gcc.gnu>
 
        PR libfortran/61049
diff --git a/gcc/testsuite/gcc.dg/torture/pr57864.c b/gcc/testsuite/gcc.dg/torture/pr57864.c
new file mode 100644 (file)
index 0000000..93962c2
--- /dev/null
@@ -0,0 +1,37 @@
+/* { dg-do compile } */
+
+union U {
+    double val;
+    union U *ptr;
+};
+
+union U *d;
+double a;
+int b;
+int c;
+
+static void fn1(union U *p1, int p2, _Bool p3)
+{
+    union U *e;
+
+    if (p2 == 0)
+       a = ((union U*)((unsigned long)p1 & ~1))->val;
+
+    if (b) {
+       e = p1;
+    } else if (c) {
+       e = ((union U*)((unsigned long)p1 & ~1))->ptr;
+       d = e;
+    } else {
+       e = 0;
+       d = ((union U*)0)->ptr;
+    }
+
+    fn1 (e, 0, 0);
+    fn1 (0, 0, p3);
+}
+
+void fn2 (void)
+{
+  fn1 (0, 0, 0);
+}