aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-patterns.c
diff options
context:
space:
mode:
authorIra Rosen <irar@il.ibm.com>2012-01-12 14:41:44 +0000
committerIra Rosen <irar@gcc.gnu.org>2012-01-12 14:41:44 +0000
commit82db3d43de58dd1c6e0c074fc2e0e85cdc09f0cc (patch)
tree3467c5cd21b186bcb2ee3ad3559793fbeb64f44e /gcc/tree-vect-patterns.c
parent869eea243d175a1c6b6ac152795c28ae986512d3 (diff)
downloadgcc-82db3d43de58dd1c6e0c074fc2e0e85cdc09f0cc.zip
gcc-82db3d43de58dd1c6e0c074fc2e0e85cdc09f0cc.tar.gz
gcc-82db3d43de58dd1c6e0c074fc2e0e85cdc09f0cc.tar.bz2
re PR tree-optimization/51799 (Compiler ICE in vect_is_simple_use_1)
PR tree-optimization/51799 * tree-vect-patterns.c (vect_recog_over_widening_pattern): Check that the last operation is a type demotion. From-SVN: r183126
Diffstat (limited to 'gcc/tree-vect-patterns.c')
-rw-r--r--gcc/tree-vect-patterns.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c
index 46d43ce..34ac2e5 100644
--- a/gcc/tree-vect-patterns.c
+++ b/gcc/tree-vect-patterns.c
@@ -1186,13 +1186,15 @@ 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. Check that USE_TYPE
- is not bigger than the original type. */
+ /* Support only type demotion or signedess change. */
if (!INTEGRAL_TYPE_P (use_type)
- || TYPE_PRECISION (new_type) > TYPE_PRECISION (use_type)
- || TYPE_PRECISION (type) < TYPE_PRECISION (use_type))
+ || TYPE_PRECISION (type) <= TYPE_PRECISION (use_type))
return NULL;
+ /* Check that NEW_TYPE is not bigger than the conversion result. */
+ if (TYPE_PRECISION (new_type) > TYPE_PRECISION (use_type))
+ return NULL;
+
if (TYPE_UNSIGNED (new_type) != TYPE_UNSIGNED (use_type)
|| TYPE_PRECISION (new_type) != TYPE_PRECISION (use_type))
{