]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/lra.c
Fix LRA bug
authorams <ams@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 14 Dec 2018 11:49:28 +0000 (11:49 +0000)
committerams <ams@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 14 Dec 2018 11:49:28 +0000 (11:49 +0000)
commit95f61091a1264856c1128b67791843a791cb415f
tree126a1387fed88b90136c7fc4ca7555804788d726
parent424c340a23b46be7ef5911f65ceac1308f6441c4
Fix LRA bug

This patch fixes an ICE building libgfortran/random.c.

The problem was an adddi3 instruction that had an eliminable frame pointer.
GCN adddi3 includes a match_scratch, which LRA substitutes with a REG, and
checks if it can be converted back to a scratch afterwards.  In the meantime,
the add was converted to a move, meaning that the instruction pattern
completely changed, thus causing a segfault when the instruction is revisited
in restore_scratches.

2018-12-14  Andrew Stubbs  <ams@codesourcery.com>

gcc/
* gcc/lra-int.h (lra_register_new_scratch_op): Add third parameter.
* gcc/lra-remat.c (update_scratch_ops): Pass icode to
lra_register_new_scratch_op.
* gcc/lra.c (struct sloc): Add icode field.
(lra_register_new_scratch_op): Add icode parameter.
Use icode to skip insns that have changed beyond recognition.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@267132 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/lra-int.h
gcc/lra-remat.c
gcc/lra.c