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 #8 from Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> ---
(In reply to Leon Winter from comment #7)
> Maybe a better solution is to hint the compiler that the loop body will be
> run at least once. A do-while seems to imply that (and the compiler does not
> print a warning).

Not for the minimized testcase. Unless you declare 'a' within the loop body,
which is not exactly equivalent.

If you declare it outside the loop body, gcc generates exactly the same code
for a 'for' and a 'do-while'.

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