Tighten check for vector types in fold_convertible_p (PR 92741)
authorRichard Sandiford <richard.sandiford@arm.com>
Mon, 2 Dec 2019 17:51:08 +0000 (17:51 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Mon, 2 Dec 2019 17:51:08 +0000 (17:51 +0000)
commitfddcfa5b84bf8a063e3e1347d787df5a36beceb2
tree6044144f87e20cc2c9695e330d90f5a6162fe782
parentc0e0174bbd7009d34e78484bbaa9e0353939819c
Tighten check for vector types in fold_convertible_p (PR 92741)

In this PR, IPA-CP was misled into using NOP_EXPR rather than
VIEW_CONVERT_EXPR to reinterpret a vector of 4 shorts as a vector
of 2 ints.  This tripped the tree-cfg.c assert I'd added in r278245.

2019-12-02  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
PR middle-end/92741
* fold-const.c (fold_convertible_p): Check vector types more
thoroughly.

gcc/testsuite/
PR middle-end/92741
* gcc.dg/pr92741.c: New test.

From-SVN: r278910
gcc/ChangeLog
gcc/fold-const.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr92741.c [new file with mode: 0644]