https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107919
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:9500877d05c56cef7bfbdcecaab3b1af2610bff3 commit r13-4406-g9500877d05c56cef7bfbdcecaab3b1af2610bff3 Author: Richard Biener <rguent...@suse.de> Date: Wed Nov 30 10:55:03 2022 +0100 tree-optimization/107919 - uninit diagnostic predicate simplification We fail to simplify ((_145 != 0B) AND (_531 == 2) AND (_109 == 0)) OR ((NOT (_145 != 0B)) AND (_531 == 2) AND (_109 == 0)) OR ((NOT (_531 == 2)) AND (_109 == 0)) because the existing simplification of !A && B || A && B is implemented too simplistic. The following re-implements that which fixes the bogus uninit diagnostic when using -O1 but not yet at -O2. PR tree-optimization/107919 * gimple-predicate-analysis.cc (predicate::simplify_2): Handle predicates of arbitrary length. * g++.dg/warn/Wuninitialized-pr107919-1.C: New testcase.