This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][committed][PR tree-optimization/82123] 01/06 Do nothing in EVRP analyzer is not optimizing
On 02/26/2018 05:27 AM, Richard Biener wrote:
> On Tue, Feb 20, 2018 at 7:49 PM, Jeff Law <law@redhat.com> wrote:
>> This is part #1 of the patches to fix 81592/82123. The changes aren't
>> particularly large or invasive, but I already had them broken down
>> internally into distinct chunks, so I'm going to send them out that way.
>>
>> This patch allows the EVRP range analyzer to be safely called even when
>> not optimizing. It does no analysis in that case. This prevents
>> problems if we were to ask for sprintf warnings but not have the
>> optimizer enabled.
>
> I don't really understand the issue -- when called from sprintf warnings
> the evrp analyzer shouldn't "optimize" anything, it only does analysis.
> How is that ever a problem when not optimizing?
When not optimizing we can have _DECL nodes showing in in places we
don't expect them. We also don't consistently canonicalize conditions.
There may be other issues as well, I didn't dig deeply into all of them.
This causes all kinds of grief when we try to analyze statements.
Ideally we'll fix this stuff in gcc-9. Until then it seems far better
to have the analyzer protect itself from this cruft than forcing every
consumer to guard calls into the analyzer.
Jeff