[Bug tree-optimization/92860] [8/9/10 regression] Global flags affected by -O settings are clobbered by optimize attribute

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jan 7 08:17:00 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92860

--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Jan Hubicka from comment #8)
> > @Richi:
> > 
> > About the param_max_fields_for_field_sensitive:
> > Do I understand it correctly that the param is used in IPA PTA for global
> > variables? If so, we can't easily use Optimization keyword as the param value
> > will not make sense to be different for different functions.
> There is global var use_field_sensitive which IMO needs to go but
> otherwise I think PTA should always analyze an assignment that is
> withing some function. So it can always query the OPTIMIZATION node of
> the function the statement lives in.

But it also affects global variables in IPA mode, and no, the effect doesn't
only materialize at stmts.  So for IPA the only thing we could do is
always use subfields for globals (but what max-fields-for-field-sensitive?)
and when analyzing stmts "pun" the fields.  And get rid of the
global use_field_sensitive flag and it's "optimization".  Ah, there's a FIXME
for globals with IPA PTA there.

That said, --param max-fields-for-field-sensitive is far from obvious to
make it per function (for IPA).  But mostly because of the effect for
'use_field_sensitive' which cannot be simply changed on/off if we actually
did end up with subfields for a variable.

I'd fear we introduce hard to track down correctness issues with "just"
flipping it to per-function.  Maybe splitting the param to a IPA and
non-IPA param works?  How do we handle other "true" IPA params considering
different TUs might be built with different settings of those as well?

> Honza


More information about the Gcc-bugs mailing list