summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr41841.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr41841.c')
-rw-r--r--gcc/testsuite/gcc.dg/pr41841.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr41841.c b/gcc/testsuite/gcc.dg/pr41841.c
new file mode 100644
index 000000000..595bc7592
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr41841.c
@@ -0,0 +1,22 @@
+/* PR tree-optimization/41841 */
+/* { dg-do compile } */
+/* { dg-options "-O -fipa-struct-reorg -fwhole-program -fipa-cp" } */
+
+typedef struct S *T;
+typedef struct { } *U;
+extern int f1 (void);
+
+static void
+f3 (U x, int y)
+{
+ T a = (T) x;
+ y && f1 ();
+}
+
+static void
+f2 (T x)
+{
+ f3 ((U) x, 1);
+}
+
+void *volatile a __attribute__((used)) = f2;