https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90710
Jeffrey A. Law <law at redhat dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2019-06-02 CC| |law at redhat dot com Ever confirmed|0 |1 --- Comment #1 from Jeffrey A. Law <law at redhat dot com> --- We focus most of our effort on avoiding false positives with -O2 optimization levels. As you lower the optimization level (-Og) you will almost certainly run into these kinds of issues. Elimination of false positive uninitialized warnings is highly dependent upon what we call "jump threading". The purpose of jump threading is to realize that certain paths through the CFG are not possible and to use block copying to isolate and remove those paths. At lower optimization levels the compiler does not aggressively thread jumps and thus can leave unexecutable paths in the CFG which leads to the false positive warning. The use of builtin_expect can have these effects too as it impacts the cost analysis done during jump threading to determine the cost/benefit of block copying to isolate the path. So confirmed, but not likely something we'll fix in the near future.