https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112581
--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> --- tree-ssa-reassoc.cc needs to call mark_ssa_maybe_undefs and checks ssa_name_maybe_undef_p similar to the way tree-ssa-ifcombine.cc does it.