https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59291
Oleg Endo <olegendo at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |NEW Last reconfirmed| |2024-05-27 --- Comment #2 from Oleg Endo <olegendo at gcc dot gnu.org> --- (In reply to pietro from comment #1) > Is this still valid? GCC 14 on the Compiler Explorer[0] show GCC 9.5 > producing the same assembly, but 12 and above (it doesn't have SH GCC 10 and > 11) produces: > > _test2: > cmp/eq r5,r4 > mov r5,r1 > add r6,r1 > add #1,r1 > rts > movt r0 > > [0]: https://godbolt.org/z/668ax5ehj Yes, still valid. Nothing has been done to explicitly address or improve the issue. The ideal code should be something like: cmp/eq r5,r4 movt r0 sett addc r5,r6 rts mov r6,r1