aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2006-02-14 09:58:57 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2006-02-14 09:58:57 +0000
commit0a4288d92e5c080b448db4041091aea932b44980 (patch)
tree3a082476ee7a2b29e659feef49b9952c45987e90 /gcc/testsuite/gcc.dg/torture
parentd1f8db0c36b50bc14d1287d04804bd51fca076cb (diff)
downloadgcc-0a4288d92e5c080b448db4041091aea932b44980.zip
gcc-0a4288d92e5c080b448db4041091aea932b44980.tar.gz
gcc-0a4288d92e5c080b448db4041091aea932b44980.tar.bz2
re PR tree-optimization/26258 (Wrong alias information for struct addresses in PHIs)
2006-02-14 Richard Guenther <rguenther@suse.de> PR tree-optimization/26258 * tree-ssa-structalias.c (find_func_aliases): Handle aggregates in PHI argument processing. * gcc.dg/torture/pr26258.c: New testcase. From-SVN: r110963
Diffstat (limited to 'gcc/testsuite/gcc.dg/torture')
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr26258.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/torture/pr26258.c b/gcc/testsuite/gcc.dg/torture/pr26258.c
new file mode 100644
index 0000000..e9acd55
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr26258.c
@@ -0,0 +1,28 @@
+/* { dg-do run } */
+
+extern void abort(void);
+
+typedef struct Foo { int a; int b; } Foo;
+
+Foo foo(Foo first, Foo last, _Bool ret_first)
+{
+ Foo t;
+ Foo *t1 = (ret_first ? &first : &last);
+ first.a = 2;
+ last.b = 3;
+ t.a = t1->a;
+ t.b = t1->b;
+ t.a += first.a;
+ t.b += last.b;
+ return t;
+}
+
+int main()
+{
+ Foo first = (Foo){1, 2};
+ Foo last = (Foo){3, 4};
+ Foo ret = foo(first, last, 0);
+ if (ret.b != 6)
+ abort ();
+ return 0;
+}