diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-12-01 06:24:29 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-12-01 06:24:29 +0000 |
commit | f24329deac63d825805147fd7c084816af66c318 (patch) | |
tree | 3c6094673888e95f2c66b8a07e514ddf36be3d53 /gcc/tree-vect-patterns.c | |
parent | 7c57630f83df248e0ed7fb5c8447c0be30852296 (diff) | |
download | gcc-f24329deac63d825805147fd7c084816af66c318.tar.gz |
2011-12-01 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 181872 using svnmerge
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@181873 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vect-patterns.c')
-rw-r--r-- | gcc/tree-vect-patterns.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c index d260e801bca..22414475f6f 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) |