* [PATCH, LRA] Fix PR 77714
@ 2016-09-26 14:12 Bernd Edlinger
2016-09-27 0:05 ` Vladimir N Makarov
0 siblings, 1 reply; 2+ messages in thread
From: Bernd Edlinger @ 2016-09-26 14:12 UTC (permalink / raw)
To: gcc-patches, Vladimir Makarov, Jeff Law
[-- Attachment #1: Type: text/plain, Size: 852 bytes --]
Hi!
This fixes another fallout of the recent change in the pattern matching,
which makes LRA choose a different alternative for this insn:
(insn 48 21 23 3 (set (reg/f:SI 102 sfp)
(reg/f:SI 7 r7)) 808 {*thumb1_movsi_insn}
(nil))
This is replaced as a special case to set((sfp)(r7-sfp_fp_elim_off)).
LRA choses thumb1_addsi3, alt 2 instead of alt 1, because sfp != r7,
while elimination of sfp->r7.
Unfortunately the insn gets a REG_EQUAL note temporarily attached,
which is spoiled by the elimination, so the reg-note is no longer
usable, and the instruction gets deleted in the final transformation.
So, as it looks like, this was a latent bug, as it is not OK to have
an alias on any RTX, except on a simple REG.
Bootstrapped and reg-tested on x86_64-pc-linux-gnu.
Is it OK for trunk?
Thanks
Bernd.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch-pr77714.diff --]
[-- Type: text/x-patch; name="patch-pr77714.diff", Size: 674 bytes --]
2016-09-26 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR rlt-optimization/77714
* lra-eliminations.c (eliminate_regs_in_insn): Avoid alias on
REG_EQUAL note.
Index: gcc/lra-eliminations.c
===================================================================
--- gcc/lra-eliminations.c (revision 240471)
+++ gcc/lra-eliminations.c (working copy)
@@ -981,7 +981,7 @@ eliminate_regs_in_insn (rtx_insn *insn, bool repla
}
lra_update_insn_recog_data (insn);
/* Add offset note for future updates. */
- add_reg_note (insn, REG_EQUAL, src);
+ add_reg_note (insn, REG_EQUAL, copy_rtx (src));
return;
}
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH, LRA] Fix PR 77714
2016-09-26 14:12 [PATCH, LRA] Fix PR 77714 Bernd Edlinger
@ 2016-09-27 0:05 ` Vladimir N Makarov
0 siblings, 0 replies; 2+ messages in thread
From: Vladimir N Makarov @ 2016-09-27 0:05 UTC (permalink / raw)
To: Bernd Edlinger, gcc-patches, Jeff Law
On 09/26/2016 09:55 AM, Bernd Edlinger wrote:
> Bootstrapped and reg-tested on x86_64-pc-linux-gnu.
> Is it OK for trunk?
>
>
>
Yes. Thank you for working on the problem, Bernd.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-09-26 21:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-26 14:12 [PATCH, LRA] Fix PR 77714 Bernd Edlinger
2016-09-27 0:05 ` Vladimir N Makarov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).