aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-1.c
diff options
context:
space:
mode:
authorAndrew Pinski <andrew_pinski@playstation.sony.com>2009-01-20 17:10:40 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2009-01-20 17:10:40 +0000
commit37348bf1059789a055e87113553bdda141db5cd0 (patch)
tree724475a560b4dd068a277f34c223a8bf205b5837 /gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-1.c
parentd0a589040b272bdc1adafd3a268d0903d418e1aa (diff)
downloadgcc-37348bf1059789a055e87113553bdda141db5cd0.zip
gcc-37348bf1059789a055e87113553bdda141db5cd0.tar.gz
gcc-37348bf1059789a055e87113553bdda141db5cd0.tar.bz2
re PR tree-optimization/38747 (Wrong code due to VIEW_CONVERT_EXPR)
2009-01-20 Andrew Pinski <andrew_pinski@playstation.sony.com> Richard Guenther <rguenther@suse.de> PR tree-optimization/38747 PR tree-optimization/38748 * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Disable the VCE conversion if the base address is an indirect reference and the aliasing sets could cause issues. * gcc.dg/tree-ssa/struct-aliasing-1.c: New test. * gcc.dg/tree-ssa/struct-aliasing-2.c: Likewise. * gcc.c-torture/execute/struct-aliasing-1.c: Likewise. Co-Authored-By: Richard Guenther <rguenther@suse.de> From-SVN: r143523
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-1.c')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-1.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-1.c b/gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-1.c
new file mode 100644
index 0000000..78e92d7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-1.c
@@ -0,0 +1,15 @@
+/* { dg-do "compile" } */
+/* { dg-options "-O2 -fdump-tree-fre" } */
+
+struct S { float f; };
+int __attribute__((noinline))
+foo (float *r, struct S *p)
+{
+ int *q = (int *)&p->f;
+ int i = *q;
+ *r = 0.0;
+ return i + *q;
+}
+
+/* { dg-final { scan-tree-dump-times "\\\*q" 1 "fre" } } */
+/* { dg-final { cleanup-tree-dump "fre" } } */