This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/81962] -Wmaybe-uninitialized refers to wrong line (and only works with -O3)


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu.org

--- Comment #3 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
> 1) The line that is referred to is not really the right one. In particular
> it does not contain any mention of 'alpha', which can be really confusing
> for larger codes.  The warning should instead refer to the line "call
> ce3(alpha)".

It should be possible to track the location of the culprit across the various
dumps and find out when things go wrong. But this is very likely to be the
effect of inlining, and gcc should be able to print an inline "stack trace": 

https://gcc.gnu.org/ml/gcc-patches/2017-12/msg00629.html

Something like:


ce.f90:9:0:

       if (a <= 0.) then

inlined from ce.f90:NN:NN:

      call ce3(alpha)

Warning: ‘alpha’ may be used uninitialized in this function
[-Wmaybe-uninitialized]

ce.f90:16:0:

       real :: alpha

note: ‘alpha’ was declared here

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]