[PATCH 01/10] Fix LRA bug

Andrew Stubbs ams@codesourcery.com
Wed Dec 12 11:52:00 GMT 2018


[This is new patch not included in the previously posted patch sets.]

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-12  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.
---
 gcc/lra-int.h   |  2 +-
 gcc/lra-remat.c |  2 +-
 gcc/lra.c       | 12 ++++++++++--
 3 files changed, 12 insertions(+), 4 deletions(-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-LRA-bug.patch
Type: text/x-patch
Size: 2874 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20181212/3d12fa98/attachment.bin>


More information about the Gcc-patches mailing list