[PATCH] Fix get_last_value_validate (PR rtl-optimization/41511)

Eric Botcazou ebotcazou@adacore.com
Sat Oct 3 10:44:00 GMT 2009

> DF_INSN_LUID is unique only within one basic block, but
> get_last_value_validate might be called with an insn from different basic
> block.  In that case the comparison of the luid with mem_last_set is
> completely meaningless, and with -g vs. -g0 caused differences in generated
> code.

Ouch!  I suspect use_crosses_set_p might be affected by the same problem then.

> Ok for trunk?

Yes, but I think we should take the opportunity (12 years later!) to document 
the purpose of the INSN argument.  Here's what I'm going to test:

	PR rtl-optimization/41511
	* combine.c (record_value_for_reg): Pass explicity value as argument
	to get_last_value_validate.
	(get_last_value_validate): Document INSN parameter.
	For non-readonly MEMs, assume they might have been modified if INSN
	was in another basic block.
	(get_last_value): Minor reformatting.

Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr41511.diff
Type: text/x-diff
Size: 3576 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20091003/60d5a1ef/attachment.bin>

More information about the Gcc-patches mailing list