https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82361
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 42262 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42262&action=edit gcc8-pr82361-wip.patch REE pass skips all instructions with multiple sets, but e.g. combiner doesn't. With the following WIP patch the unnecessary zero extension is gone, similarly for unsigned long long foo (unsigned a, unsigned b) { return a / b; } But I think a couple more are needed to also deal with signed division and the various optimizations.