ira: Don't substitute into TRAP_IF insns (PR78610)
commit033e1fffa6fe2903eb91dc384cce53c6362c6062
authorsegher <segher@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 30 Nov 2016 14:47:01 +0000 (30 14:47 +0000)
committersegher <segher@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 30 Nov 2016 14:47:01 +0000 (30 14:47 +0000)
tree3a1302d543b539cda495047e59dba693b11caf0d
parent5f3234cfaee0d298e2f0eb70da1230cbf27fec41
ira: Don't substitute into TRAP_IF insns (PR78610)

In the testcase, IRA propagates a constant into a TRAP_IF insn, which
then becomes an unconditional trap.  Unconditional traps are control
flow insns so doing this requires surgery on the cfg.  We cannot do
that here, so instead refuse to do the substitution.

PR rtl-optimization/78610
* ira.c (combine_and_move_insns): Don't substitute into TRAP_IF
instructions.

gcc/testsuite/
PR rtl-optimization/78610
* gcc.c-torture/compile/pr78610.c: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@243028 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/ira.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr78610.c [new file with mode: 0644]