https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109601
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2023-04-23 Status|UNCONFIRMED |NEW Ever confirmed|0 |1 --- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- x86 duplicated the simple return but never unduplicates it: (jump_insn 27 12 28 3 (simple_return) 1030 {simple_return_internal} (nil) -> simple_return) ... (jump_insn 32 31 33 4 (simple_return) "/app/example.cpp":29:1 -1 (nil) -> simple_return) But simple_return was only added in GCC 4.7.0 (r0-111280-g268987713c7105c691) So something else changed. There is also a missed optimization earlier because jump2 is way late to be optimizing this case. Also this is just an issue with return so it might not be as important as most people think (the other missed optimization earlier is though).