summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/tree-vect-generic.c11
2 files changed, 16 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 96fce899fd2..74b1139225c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2011-10-06 Richard Guenther <rguenther@suse.de>
+
+ * tree-vect-generic.c (vector_element): Look at previous
+ generated results.
+
2011-10-06 David Edelsohn <dje.gcc@gmail.com>
PR target/39950
diff --git a/gcc/tree-vect-generic.c b/gcc/tree-vect-generic.c
index ef03b355f78..8f9f2a836d8 100644
--- a/gcc/tree-vect-generic.c
+++ b/gcc/tree-vect-generic.c
@@ -536,6 +536,17 @@ vector_element (gimple_stmt_iterator *gsi, tree vect, tree idx, tree *ptmpvec)
idx = build_int_cst (TREE_TYPE (idx), index);
}
+ /* When lowering a vector statement sequence do some easy
+ simplification by looking through intermediate vector results. */
+ if (TREE_CODE (vect) == SSA_NAME)
+ {
+ gimple def_stmt = SSA_NAME_DEF_STMT (vect);
+ if (is_gimple_assign (def_stmt)
+ && (gimple_assign_rhs_code (def_stmt) == VECTOR_CST
+ || gimple_assign_rhs_code (def_stmt) == CONSTRUCTOR))
+ vect = gimple_assign_rhs1 (def_stmt);
+ }
+
if (TREE_CODE (vect) == VECTOR_CST)
{
unsigned i;