aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2011-10-05 09:31:40 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2011-10-05 09:31:40 +0000
commiteb8f1123d9a6e25c288cac5a34e050c5292fd5b6 (patch)
treef4c2c3c0ea4056b132962dc93a348d4034f90d01
parent2c893b9dbc44525c276c8d7a28ce6571758d973c (diff)
downloadgcc-eb8f1123d9a6e25c288cac5a34e050c5292fd5b6.zip
gcc-eb8f1123d9a6e25c288cac5a34e050c5292fd5b6.tar.gz
gcc-eb8f1123d9a6e25c288cac5a34e050c5292fd5b6.tar.bz2
re PR middle-end/50609 (FAIL: gcc.c-torture/execute/pr23135.c compilation, -O2 -flto (ICE))
2011-10-05 Richard Guenther <rguenther@suse.de> PR tree-optimization/50609 * gimple-fold.c (fold_array_ctor_reference): Also handle vector typed constructors. (fold_ctor_reference): Dispatch to fold_array_ctor_reference for vector typed constructors. From-SVN: r179540
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/gimple-fold.c7
2 files changed, 13 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9147e87..21910f2 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2011-10-05 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/50609
+ * gimple-fold.c (fold_array_ctor_reference): Also handle
+ vector typed constructors.
+ (fold_ctor_reference): Dispatch to fold_array_ctor_reference
+ for vector typed constructors.
+
2011-10-05 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.c (ix86_emit_binop): New static function.
diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c
index f8e5035..179535e 100644
--- a/gcc/gimple-fold.c
+++ b/gcc/gimple-fold.c
@@ -2747,10 +2747,12 @@ fold_array_ctor_reference (tree type, tree ctor,
double_int low_bound, elt_size;
double_int index, max_index;
double_int access_index;
- tree domain_type = TYPE_DOMAIN (TREE_TYPE (ctor));
+ tree domain_type = NULL_TREE;
HOST_WIDE_INT inner_offset;
/* Compute low bound and elt size. */
+ if (TREE_CODE (TREE_TYPE (ctor)) == ARRAY_TYPE)
+ domain_type = TYPE_DOMAIN (TREE_TYPE (ctor));
if (domain_type && TYPE_MIN_VALUE (domain_type))
{
/* Static constructors for variably sized objects makes no sense. */
@@ -2917,7 +2919,8 @@ fold_ctor_reference (tree type, tree ctor, unsigned HOST_WIDE_INT offset,
if (TREE_CODE (ctor) == CONSTRUCTOR)
{
- if (TREE_CODE (TREE_TYPE (ctor)) == ARRAY_TYPE)
+ if (TREE_CODE (TREE_TYPE (ctor)) == ARRAY_TYPE
+ || TREE_CODE (TREE_TYPE (ctor)) == VECTOR_TYPE)
return fold_array_ctor_reference (type, ctor, offset, size);
else
return fold_nonarray_ctor_reference (type, ctor, offset, size);