re PR tree-optimization/92401 (ICE in fold_ternary_loc, at fold-const.c:11698)
authorJakub Jelinek <jakub@redhat.com>
Sat, 9 Nov 2019 17:09:44 +0000 (18:09 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Sat, 9 Nov 2019 17:09:44 +0000 (18:09 +0100)
commitc47bee97fa9927563a5015b28e24a5505ba557a3
tree25d71a8d63b489e51267aa227f35fdd7caf84c5d
parentb03932cb99afb634786a8000e447fb21fad115d0
re PR tree-optimization/92401 (ICE in fold_ternary_loc, at fold-const.c:11698)

PR tree-optimization/92401
* gimple-match-head.c (gimple_resimplify1): Call const_unop only
if res_op->code is an expression with code length 1.
* gimple-match-head.c (gimple_resimplify2): Call const_binop only
if res_op->code is an expression with code length 2.
* gimple-match-head.c (gimple_resimplify3): Call fold_ternary only
if res_op->code is an expression with code length 3.

* g++.dg/opt/pr92401.C: New test.

From-SVN: r278004
gcc/ChangeLog
gcc/gimple-match-head.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/opt/pr92401.C [new file with mode: 0644]