https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66511
Roger Sayle <roger at nextmovesoftware dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |roger at nextmovesoftware dot com --- Comment #4 from Roger Sayle <roger at nextmovesoftware dot com> --- Created attachment 54871 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54871&action=edit proposed patch Proposed patch, using a peephole2 in avr-dimode.md to inline calls to __lshrdi3 that require only a single instruction or two (due to truncation). For truncations to char, this is smaller and faster, and for truncations to unsigned short this is the same size, but faster. The drawback is that performing this late (in peephole2) doesn't eliminate the stack frame prolog/epilog. Thoughts?