https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95798
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org --- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 50249 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50249&action=edit gcc11-pr95798.patch Untested fix. The #c4 qux case above is not fixed by it, but it isn't a regression, so I think we should defer that one for GCC 12 (file a separate PR for that). And, it would work (if done e.g. at expansion time) only when there is signed integer overflow, so not for -fwrapv nor when e.g. the narrower type is unsigned, so I think we need the single_use match.pd case because after those changes, there is no way to undo that.