[Bug c/68656] [4.9/5/6 Regression] warning about disabled var-tracking uses odd location info

manu at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Dec 2 22:54:00 GMT 2015


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

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-12-02
                 CC|                            |manu at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #3 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
This is "documented" here: https://gcc.gnu.org/wiki/DiagnosticsGuidelines

When the diagnostic does not refer to a particular source code location, it
should use an explicit UNKNOWN_LOCATION rather than no location at all (since
the latter uses input_location implicitly and who knows what that is pointing
at). It is always better to pass input_location explicitly rather than
implicitly. 

Unfortunately, there are still many many places in GCC that use warning/error
instead of warning_at/error_at.

(In reply to Richard Biener from comment #1)
> Which version worked ok?  I think these warnings should simply not output
> any location (well, as we now have per-function optimization settings such
> warning
> may apply only for certain functions...)

Is process_options called at all for per-function optimization settings? It
doesn't seem to. There is a finish_options that actually takes a location_t
argument and it is called for per-function optimization options.


More information about the Gcc-bugs mailing list