[Bug c++/94905] Bogus warning -Werror=maybe-uninitialized

2020-07-02 Thread moller at mollerware dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94905

Chris Moller  changed:

   What|Removed |Added

 CC||moller at mollerware dot com

--- Comment #7 from Chris Moller  ---
A little follow-up:

What's happening is that in gcc/tree-ssa-uninit.c, in
pass_late_warn_uninitialized::execute (function *fun),
warn_uninitialized_vars() is called with an argument of 1.  Then, in
warn_uninitialized_vars(), walk_aliased_vdefs (&ref, use, check_defs, &data,
NULL,&fentry_reached, limit); is called, returning with fentry_reached set to
false, which then leads to the warning being generated.

In gcc/tree-ssa-alias.c, in walk_aliased_vdefs_1(), *function_entry_reached =
true; is never reached because gimple_nop_p (def_stmt) never returns true.

I've attached a bit of preprocessed sample code that reliably fails with 

g++ -DHAVE_CONFIG_H -I. -I..-Wall -I sql -Werror -rdynamic -g -O2 -MT
apl-Shape.o -MD -MP -MF .deps/apl-Shape.Tpo -c Shape-preprocessed.cc

[Bug c++/94905] Bogus warning -Werror=maybe-uninitialized

2020-07-02 Thread moller at mollerware dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94905

--- Comment #8 from Chris Moller  ---
Created attachment 48825
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48825&action=edit
Preprocessed testcase

gunzip  then compile with 

g++ -DHAVE_CONFIG_H -I. -I..-Wall -I sql -Werror -rdynamic -g -O2 -MT
apl-Shape.o -MD -MP -MF .deps/apl-Shape.Tpo -c Shape-preprocessed.cc