https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110556
--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Created attachment 55485 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55485&action=edit Reduced testcase Compile with ` -O2 -fno-tree-fre -fno-delete-dead-exceptions -fnon-call-exceptions` to make sure the division stays around. Note the interesting thing is if I remove the loop in func_6, the code generation for safe_mul_func_int64_t_s_s changes (to be correct). (that is just call func_34/func_30 in func_6).