[patch, avr] Take 2: Fix PR64331: insn output and insn length computation rely on REG_DEAD notes.

Georg-Johann Lay avr@gjlay.de
Thu Feb 26 20:11:00 GMT 2015


Am 02/23/2015 um 11:53 AM schrieb Georg-Johann Lay:
> This patch fixes PR64331 which produced wrong code because of outdated (too
> many) REG_DEAD notes.  These notes are not (re)computed per default, hence do
> the computation by hand each time avr.c:reg_unused_after is called in a
> different pass.

Let me drop that...  Problem was that df relies on cfg which is down after a 
specific point (after pass .*free_cfg).

Take #2 introduces a new, avr-specific rtl pass whose sole purpose is to 
rectify notes.  The pass is scheduled right before cfg does down (right before 
.*free_cfg) so that cfg and hence df machinery is available.

Regression tests look fine and for the test case the patches produce correct 
code and correct insn length.

Ok for trunk and 4.9?

Johann


gcc/
	PR target/64331
	* config/avr/avr.c (context.h, tree-pass.h): Include them.
	(avr_pass_data_recompute_notes): New static variable.
	(avr_pass_recompute_notes): New class.
	(avr_register_passes): New static function.
	(avr_option_override): Call it.

gcc/testsuite/
	PR target/64331
	* gcc.target/avr/torture/pr64331.c: New test.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr64331-5.diff
Type: text/x-patch
Size: 2962 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20150226/14a42449/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr64331-49.diff
Type: text/x-patch
Size: 3046 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20150226/14a42449/attachment-0001.bin>


More information about the Gcc-patches mailing list