diff options
author | Steven Bosscher <stevenb.gcc@gmail.com> | 2006-01-23 09:47:01 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2006-01-23 09:47:01 +0000 |
commit | d239ed56aba8ec4d6d91d77fedecbc1674a2d3b7 (patch) | |
tree | 6cabb48df9b8cfad2881998e1a67ab45201463ae /gcc/testsuite/gcc.dg/torture | |
parent | 0f01f026dc4f3f265545bd112583c4756933e31a (diff) | |
download | gcc-d239ed56aba8ec4d6d91d77fedecbc1674a2d3b7.zip gcc-d239ed56aba8ec4d6d91d77fedecbc1674a2d3b7.tar.gz gcc-d239ed56aba8ec4d6d91d77fedecbc1674a2d3b7.tar.bz2 |
re PR rtl-optimization/25654 (RTL alias analysis unprepared to handle stack slot sharing)
2006-01-23 Steven Bosscher <stevenb.gcc@gmail.com>
Jan Hubicka <jh@suse.cz>
Richard Guenther <rguenther@suse.de>
PR rtl-optimization/25654
* cfgexpand.c (aggregate_contains_union_type): New function.
(add_alias_set_conflicts): Call it. Make sure to add conflicts
for structure variables that contain a union type.
* gcc.dg/torture/pr25654.c: New testcase.
* gcc.target/i386/pr25654.c: Likewise.
Co-Authored-By: Jan Hubicka <jh@suse.cz>
Co-Authored-By: Richard Guenther <rguenther@suse.de>
From-SVN: r110109
Diffstat (limited to 'gcc/testsuite/gcc.dg/torture')
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr25654.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/torture/pr25654.c b/gcc/testsuite/gcc.dg/torture/pr25654.c new file mode 100644 index 0000000..03761e9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr25654.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ + +extern void abort (void) __attribute__((noreturn)); + +union setconflict +{ + short a[20]; + int b[10]; +}; + +int +main () +{ + int sum = 0; + { + union setconflict a; + short *c; + c = a.a; + asm ("": "=r" (c):"0" (c)); + *c = 0; + asm ("": "=r" (c):"0" (c)); + sum += *c; + } + { + union setconflict a; + int *c; + c = a.b; + asm ("": "=r" (c):"0" (c)); + *c = 1; + asm ("": "=r" (c):"0" (c)); + sum += *c; + } + + if (sum != 1) + abort(); + return 0; +} |