From d239ed56aba8ec4d6d91d77fedecbc1674a2d3b7 Mon Sep 17 00:00:00 2001 From: Steven Bosscher Date: Mon, 23 Jan 2006 09:47:01 +0000 Subject: re PR rtl-optimization/25654 (RTL alias analysis unprepared to handle stack slot sharing) 2006-01-23 Steven Bosscher Jan Hubicka Richard Guenther 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 Co-Authored-By: Richard Guenther From-SVN: r110109 --- gcc/testsuite/gcc.dg/torture/pr25654.c | 37 ++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/torture/pr25654.c (limited to 'gcc/testsuite/gcc.dg/torture') 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; +} -- cgit v1.1