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 tree-optimization/65178] incorrect -Wmaybe-uninitialized when using nested loops


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

--- Comment #14 from Leon Winter <winter-gcc@bfw-online.de> ---
I am not sure how smart he diagnostic of GCC is supposed to be it seems that
the source base of GCC itself has fallen victim to the false warning.

The following commit fixes a -Wmaybe-uninitialized warning:
commit 4dae4a1aef68d3947f10a2901c957784958f212a
Author: jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Sun Jan 17 18:04:47 2016 +0000

        * omp-low.c (mark_loops_in_oacc_kernels_region): Work around
        -Wmaybe-uninitialized warning.


    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232484
138bc75d-0d04-0410-961f-82ee72b054a4

However looking at the source code at the point of the actual usage of the
variable it must be set. The branch-return-condition before ensures
nr_outer_loops == 1 which can only be true if it was set in the loop. If that
is true, the variable single_outer must be set to loop which is again must be
!= null (as per loop breaking condition).
The commiter called the change a "work around" which indicates he was aware the
initialization might not have been needed.

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