aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg
diff options
context:
space:
mode:
authorSteven Bosscher <stevenb@suse.de>2005-09-29 12:25:10 +0000
committerSteven Bosscher <steven@gcc.gnu.org>2005-09-29 12:25:10 +0000
commit1ebd8d9ac1a51af9a1a65f1db575fd2499835074 (patch)
treebb658ab7113eb0a075f5c79afff242ff5018b2f5 /gcc/testsuite/gcc.dg
parent577b2a064ee8634cd57b36cecddb4e9e2a57e51c (diff)
downloadgcc-1ebd8d9ac1a51af9a1a65f1db575fd2499835074.zip
gcc-1ebd8d9ac1a51af9a1a65f1db575fd2499835074.tar.gz
gcc-1ebd8d9ac1a51af9a1a65f1db575fd2499835074.tar.bz2
re PR tree-optimization/23911 (Failure to propagate constants from a const initializer for _Complex)
gcc/ PR tree-optimization/23911 * tree-ssa-ccp.c (fold_const_aggregate_ref): Handle REALPART_EXPR and IMAGPART_EXPR too. testsuite/ * gcc.dg/pr23911.c: New test. From-SVN: r104771
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r--gcc/testsuite/gcc.dg/pr23911.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr23911.c b/gcc/testsuite/gcc.dg/pr23911.c
new file mode 100644
index 0000000..1003075
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr23911.c
@@ -0,0 +1,22 @@
+/* This was a missed optimization in tree constant propagation
+ that CSE would catch later on. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-store_ccp" } */
+
+double _Complex *a;
+const double _Complex b[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
+
+void
+test (void)
+{
+ a[0] = b[0] + b[1];
+ a[1] = b[0] + b[1];
+ return;
+}
+
+/* After store_ccp, there should not be any assignments from real or
+ imaginary parts anymore. The constants should be loaded from b and
+ propagated into the elements of a. */
+/* { dg-final { scan-tree-dump-times "= CR" 0 "store_ccp" } } */
+/* { dg-final { scan-tree-dump-times "= CI" 0 "store_ccp" } } */
+/* { dg-final { cleanup-tree-dump "store_ccp" } } */