summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErick Ochoa <erick.ochoa@theobroma-systems.com>2020-04-29 12:27:58 +0200
committerErick Ochoa <erick.ochoa@theobroma-systems.com>2020-04-29 12:27:58 +0200
commit0c671014c9c48959140465c58417d57141e68854 (patch)
treed947b0aa775e0f6c0e576f3f1debab5786800970
parentcf2feafa7e367cf1f115abe0099d5fde94d52b8b (diff)
Adds csmith test #5
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipa-structreorg-56-csmith-5.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-56-csmith-5.c b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-56-csmith-5.c
new file mode 100644
index 00000000000..27da3daa29d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-56-csmith-5.c
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+/* { dg-options "-w -flto -flto-partition=none -fipa-dead-field-eliminate" } */
+
+#include <stdint.h>
+struct a {
+ int8_t b
+};
+struct c {
+ struct a d
+} e[];
+
+/* Analysis failed because e[2].d was considered not read
+ * we were only looking at e[2].d.b which is considered read.
+ * So we need to recurse
+ */
+f() { g(e[2].d.b, 0); }
+
+void g(int8_t a, int8_t b) { a + b ;}
+main() {}