Fix over-widening handling of COND_EXPRs (PR 86749)
commite95d867aa5650ad734fbd9922a5547bb2d17f480
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 1 Aug 2018 14:40:35 +0000 (1 14:40 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 1 Aug 2018 14:40:35 +0000 (1 14:40 +0000)
tree1c73f7e0d6103bcca887c20c97a53240e62ba7f2
parent30ac4a8261f4f5e4af182e969d1bad68993f8755
Fix over-widening handling of COND_EXPRs (PR 86749)

This PR is a wrong-code bug caused by the over-widening support.
The minimum input precisions for a COND_EXPR are supposed to apply
only to the "then" and "else" values, but here we were applying
them to the operands of a nested COND_EXPR comparison instead.

2018-08-01  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
PR tree-optimization/86749
* tree-vect-patterns.c (vect_determine_min_output_precision_1):
If the lhs is used in a COND_EXPR, check that it is being used
as the "then" or "else" value.

gcc/testsuite/
PR tree-optimization/86749
* gcc.dg/vect/pr86749.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263213 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/pr86749.c [new file with mode: 0644]
gcc/tree-vect-patterns.c