aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-patterns.c
diff options
context:
space:
mode:
authorIra Rosen <ira.rosen@linaro.org>2011-11-29 07:00:53 +0000
committerIra Rosen <irar@gcc.gnu.org>2011-11-29 07:00:53 +0000
commitb2a1a74d994a2da3f69ee7320b7c0de5387df6ed (patch)
treed3ecf3c65cbd7e736351c23e3e95e50a8572f764 /gcc/tree-vect-patterns.c
parentdb4e52814df0022e937794d28cca0d159c76a890 (diff)
downloadgcc-b2a1a74d994a2da3f69ee7320b7c0de5387df6ed.zip
gcc-b2a1a74d994a2da3f69ee7320b7c0de5387df6ed.tar.gz
gcc-b2a1a74d994a2da3f69ee7320b7c0de5387df6ed.tar.bz2
re PR tree-optimization/51301 (Compiler ICE in vect_is_simple_use_1)
PR tree-optimization/51301 * tree-vect-patterns.c (vect_recog_over_widening_pattern): Check that the last statement doesn't convert to a bigger type than the original type of the computation. From-SVN: r181797
Diffstat (limited to 'gcc/tree-vect-patterns.c')
-rw-r--r--gcc/tree-vect-patterns.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c
index d260e80..2241447 100644
--- a/gcc/tree-vect-patterns.c
+++ b/gcc/tree-vect-patterns.c
@@ -1088,6 +1088,7 @@ vect_recog_over_widening_pattern (VEC (gimple, heap) **stmts,
tree var = NULL_TREE, new_type = NULL_TREE, tmp, new_oprnd;
bool first;
struct loop *loop = (gimple_bb (stmt))->loop_father;
+ tree type = NULL;
first = true;
while (1)
@@ -1150,6 +1151,7 @@ vect_recog_over_widening_pattern (VEC (gimple, heap) **stmts,
print_gimple_stmt (vect_dump, pattern_stmt, 0, TDF_SLIM);
}
+ type = gimple_expr_type (stmt);
prev_stmt = stmt;
stmt = use_stmt;
@@ -1165,9 +1167,11 @@ vect_recog_over_widening_pattern (VEC (gimple, heap) **stmts,
{
use_lhs = gimple_assign_lhs (use_stmt);
use_type = TREE_TYPE (use_lhs);
- /* Support only type promotion or signedess change. */
+ /* Support only type promotion or signedess change. Check that USE_TYPE
+ is not bigger than the original type. */
if (!INTEGRAL_TYPE_P (use_type)
- || TYPE_PRECISION (new_type) > TYPE_PRECISION (use_type))
+ || TYPE_PRECISION (new_type) > TYPE_PRECISION (use_type)
+ || TYPE_PRECISION (type) < TYPE_PRECISION (use_type))
return NULL;
if (TYPE_UNSIGNED (new_type) != TYPE_UNSIGNED (use_type)