Fix PR middle-end/71654 (missed shortening of a compare)
authorPatrick Palka <ppalka@gcc.gnu.org>
Fri, 12 Aug 2016 16:07:40 +0000 (16:07 +0000)
committerPatrick Palka <ppalka@gcc.gnu.org>
Fri, 12 Aug 2016 16:07:40 +0000 (16:07 +0000)
commit7fd82d528e715fabf3688346250d47c20f149665
treec1db4a73282537a4a6550488a4eab0f1005536cc
parent2f1364c2b325eec008bf461a0d77264618a9afe8
Fix PR middle-end/71654 (missed shortening of a compare)

gcc/ChangeLog:

PR middle-end/71654
* match.pd ((T)A CMP (T)B -> A CMP B): Allow (T)A to be a
sign-changing cast from a shorter unsigned type to a wider
signed type.

gcc/testsuite/ChangeLog:

PR middle-end/71654
* gcc.dg/c-c++-common/pr71654.c: New test.
* gcc.dg/tree-ssa/vrp23: Add -fno-tree-forwprop to
dg-options.
* gcc.dg/tree-ssa/vrp24: Likewise.

From-SVN: r239421
gcc/ChangeLog
gcc/match.pd
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/pr71654.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/vrp23.c
gcc/testsuite/gcc.dg/tree-ssa/vrp24.c