On 01/14/2016 03:15 AM, Kyrill Tkachov wrote:
There are cases where calls to fold_rtx with a non-NULL insn don't
end up modifying src, ending up in src to not be always equal to
src_folded (I added an assert to that effect and saw it trigger). It
seems that fold_rtx is not *guaranteed* to modify src if insn is
non-NULL, but it just does in many cases.
Right. That's roughly what I'd expect.
Alternately you could compute stuff for "SRC" prior to the call to
fold_rtx. It's less likely to have unexpected side effects.
My inclination would be to go with changing INSN to NULL though. It
seems to match the overall intent here better.
I agree and, as I said, I saw no impact on codegen for all of
SPEC2006 on arm. It just improved the testcase I described above.
I'll evaluate this patch on aarch64 and x86_64 and hopefully it has a
low impact there as well.
Sounds good.
jeff