diff options
author | Richard Guenther <rguenther@suse.de> | 2009-06-03 15:30:52 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2009-06-03 15:30:52 +0000 |
commit | 3111cce0d99ddd6414f38042cd3e19aeee2f9cc4 (patch) | |
tree | e6ef21402faec30aac26293ccd3333d303df009c | |
parent | 5e1b50f68bda115d24af7f9ff13196e488eb59a5 (diff) | |
download | gcc-3111cce0d99ddd6414f38042cd3e19aeee2f9cc4.zip gcc-3111cce0d99ddd6414f38042cd3e19aeee2f9cc4.tar.gz gcc-3111cce0d99ddd6414f38042cd3e19aeee2f9cc4.tar.bz2 |
re PR middle-end/40328 (internal compiler error: in set_ssa_val_to, at tree-ssa-sccvn.c:1811)
2009-06-03 Richard Guenther <rguenther@suse.de>
PR middle-end/40328
* fold-const.c (fold_convert): Fold the build COMPLEX_EXPR.
* gcc.dg/torture/pr40328.c: New testcase.
From-SVN: r148134
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/fold-const.c | 7 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr40328.c | 11 |
4 files changed, 25 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 523c161..d426129 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2009-06-03 Richard Guenther <rguenther@suse.de> + + PR middle-end/40328 + * fold-const.c (fold_convert): Fold the build COMPLEX_EXPR. + 2009-06-03 Andrey Belevantsev <abel@ispras.ru> * statistics.c (statistics_counter_event): Do not record event diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 03f6805..ab3942f 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -2643,9 +2643,10 @@ fold_convert (tree type, tree arg) case POINTER_TYPE: case REFERENCE_TYPE: case REAL_TYPE: case FIXED_POINT_TYPE: - return build2 (COMPLEX_EXPR, type, - fold_convert (TREE_TYPE (type), arg), - fold_convert (TREE_TYPE (type), integer_zero_node)); + return fold_build2 (COMPLEX_EXPR, type, + fold_convert (TREE_TYPE (type), arg), + fold_convert (TREE_TYPE (type), + integer_zero_node)); case COMPLEX_TYPE: { tree rpart, ipart; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2fe13e1..d2c9247 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-06-03 Richard Guenther <rguenther@suse.de> + + PR middle-end/40328 + * gcc.dg/torture/pr40328.c: New testcase. + 2009-06-03 Martin Jambor <mjambor@suse.cz> * g++.dg/torture/pr40323.C: New file. diff --git a/gcc/testsuite/gcc.dg/torture/pr40328.c b/gcc/testsuite/gcc.dg/torture/pr40328.c new file mode 100644 index 0000000..e378e63 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr40328.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-fno-tree-sra" } */ + +_Complex float foo(void) +{ + _Complex float a[64] = {}; + _Complex float x; + x = a[1]; + return x; +} + |