https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120048
--- Comment #9 from Andrew Macleod <amacleod at redhat dot com> --- Created attachment 61274 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61274&action=edit potential patch (In reply to Andrew Macleod from comment #8) > > Another option is to add a type to UNDEFINED, which I have looked at before. > That has its own issues, but I will take another look in a bit. I have prototyped this, and can confirm that adding a type to UNDEFINED does resolve the problem. That seems like overkill for back porting however. it looks like there are only 2 places where this is a real risk.. And since it can only happen when code is going to be unreachable, we could simply turn the UNDEFINED into a VARYING value... like this patch. The testcase still reduces down to return 0. I'm running it through testing now. This would be suitable fix for gcc 14/15. For trunk I could apply this and the revert it if I do either of the other options.. (ie add a type to UNDEFINED or always keep the mask up to date)