diff options
author | Erick Ochoa <erick.ochoa@theobroma-systems.com> | 2020-04-29 11:11:02 +0200 |
---|---|---|
committer | Erick Ochoa <erick.ochoa@theobroma-systems.com> | 2020-05-14 14:45:53 +0200 |
commit | 184fdb45b5c90050dbc1e5fe2b0d73e4dedd99fb (patch) | |
tree | c4ddafce55ecdd8bfe7062e9a6eedadfbd265628 | |
parent | 2a2f904d0943c2982abd53ef878971dd2b7319db (diff) |
Adds test case for bug #3 found by csmith
-rw-r--r-- | gcc/testsuite/gcc.dg/ipa/ipa-structreorg-54-csmith-3.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-54-csmith-3.c b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-54-csmith-3.c new file mode 100644 index 00000000000..f49627eeeba --- /dev/null +++ b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-54-csmith-3.c @@ -0,0 +1,21 @@ +/* { dg-do run } */ +/* { dg-options "-w -flto -flto-partition=none -fipa-dead-field-eliminate" } */ + +#include <stdint.h> +//TODO: So, our analysis says that we are deleting a field "a". +//And that the field "a" is contained in struct "b". +//However, we are doing is_interesting_struct("c") == yes +//is_interesting_field("a") == yes +//and so we delete field a from struct c. +struct { + uint64_t a +} b[]; +struct { + unsigned : 5; + unsigned a +} c; +d() { + uint16_t e = b; + int8_t f = c.a; +} +main() {} |