[Bug tree-optimization/59932] spurious undefined behavior warning on valid code
su at cs dot ucdavis.edu
gcc-bugzilla@gcc.gnu.org
Thu Jan 30 01:38:00 GMT 2014
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59932
Zhendong Su <su at cs dot ucdavis.edu> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |FIXED
--- Comment #8 from Zhendong Su <su at cs dot ucdavis.edu> ---
(In reply to Jakub Jelinek from comment #7)
> (In reply to Zhendong Su from comment #6)
> > Thanks for your explanation Jakub. It's more clear now, but I still don't
> > fully understand the difference in behavior from 4.8 to the current trunk.
> >
> > Is it because 4.8's support for warning undefined behaviors is weaker than
> > 4.9's, and with that enhanced support, 4.9 sometimes gives false warnings
> > like the one reported here?
>
> 4.8 only warned about this in later passes when the loops have been already
> constructed and preserved, so it wouldn't warn e.g. if it was cunrolli (as
> in this case) that found the undefined behavior. GCC 4.9 creates loops
> immediately after cfg is created and the warning is thus enabled much
> earlier. This means we warn in more cases when it is desirable to warn, but
> as this testcase shows also sometimes means there can be false positives.
> The loop with the undefined behavior is there for many passes, from cunrolli
> where it warns another 20 passes until dom1 is able to find out the code is
> dead.
Thanks
More information about the Gcc-bugs
mailing list