https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81897
Jeffrey A. Law <law at redhat dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aldyh at redhat dot com, | |law at redhat dot com --- Comment #3 from Jeffrey A. Law <law at redhat dot com> --- So this really doesn't have anything to do with locking, mutexes or anything like that. It's really just a matter of the CFG having a shape that is problematical for the old jump threader. To thread the CFG (and thus allow proving the uninitialized use is properly guarded) requires iterating jump threading. That's something we decided years ago to stop doing due to the compilation cost. Aldy is working on improvements to the newer backwards jump threader which will give it a fighting chance to address this problem. The biggest worry there will be the amount of block copying that will be necessary to expose the flow of the known value of fibmatch through all the paths between the two conditionals. An alternate solution would be to enhance the predicate analysis that is used to prune uninit warnings in tree-ssa-uninit.c. Fixing the threader is strongly preferred because threading the jumps ultimately reduces the amount of runtime branching the code does as opposed to just avoiding the warning. I'm cc-ing Aldy just in case he wants to peek and see if his work does capture the jump thread in this BZ or if he wants to dig into tree-ssa-uninit.c again :-)