aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57864.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57864.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57864.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57864.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57864.c
new file mode 100644
index 000000000..93962c20e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57864.c
@@ -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);
+}