On 10/30/14 01:36, Jakub Jelinek wrote:
On Wed, Oct 29, 2014 at 09:47:33PM -0600, Jeff Law wrote:
On 10/27/14 14:47, Jakub Jelinek wrote:
Hi!
The following testcase is miscompiled in 4.8+ on x86_64 at -O2+,
because REE widens for ZERO_EXTEND mode on
(set (reg:QI ax) (const_int -1)) instruction to SImode, but doesn't
adjust REG_EQUAL note of (const_int -1) also to (const_int 0xff)
like it changes the pattern.
The following patch attempts to adjust the notes if they are CONST_INT,
or drop otherwise (not sure if it would be desirable to emit
a ZERO_EXTEND of the previous content of the note), and both through
validate_change, so that if we give up later on, it is undone.
Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
What about 4.9.2 (after release) and 4.8.x?
2014-10-27 Jakub Jelinek <ja...@redhat.com>
PR rtl-optimization/63659
* ree.c (update_reg_equal_equiv_notes): New function.
(combine_set_extension, transform_ifelse): Use it.
* gcc.c-torture/execute/pr63659.c: New test.
Does this do the right thing in the case where there's multiple reaching
definitions and one of those reaching definitions turns out to be
non-combinable, while some other has a fixable REG_EQUAL note?
The changes to REG_EQUAL or REG_EQUIV notes (either adjustment of CONST_INT
in it, or its removal) is tied to the changing of the insn holding it
in the patch.
Doh! I should have realized that. Objection removed. OK for the trunk.
jeff