This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix reload1.c warning for some targets
- From: Jeff Law <law at redhat dot com>
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, richard dot sandiford at arm dot com
- Date: Tue, 11 Aug 2015 14:04:58 -0600
- Subject: Re: Fix reload1.c warning for some targets
- Authentication-results: sourceware.org; auth=none
- References: <87d1z1kedx dot fsf at e105548-lin dot cambridge dot arm dot com> <55C24163 dot 9040405 at redhat dot com> <87pp31iqt4 dot fsf at e105548-lin dot cambridge dot arm dot com>
On 08/05/2015 11:32 AM, Richard Sandiford wrote:
and I don't see how GCC could prove that eliminate_regs_1 doesn't
modify the value of recog_data.n_dups between the two loops.
eliminate_regs_1 calls functions like plus_constant that are defined
outside the TU and that certainly aren't pure/const.
Right. I should have been clearer. I don't think the reload1.c code is
a false positive because we can't see into those functions to determine
side effects.
So I think c#5 (marked as a bogus reduction) is an accurate reflection
of what reload1.c does. c#4 looks like a genuine bug but seems different
from the reload1.c case. If we still warn for c#4 then I think we
should keep the bugzilla entry open for that, but the warning for the
reload1.c code seems justified.
Right. I don't want to lose the false positive and associated missed
jump threading in c#4.
Perhaps the question is why it doesn't trigger on more targets :-)
Not sure. Could be how match_dup is used plus some interactions with
SRA and BRANCH_COST and who knows what else :-0
Jeff