http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54183
Bug #: 54183 Summary: Generate __udivmoddi4 instead of __udivdi3 plus __umoddi3 Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: rtl-optimization AssignedTo: unassig...@gcc.gnu.org ReportedBy: ji...@gmx.net CC: a...@gcc.gnu.org As the subject says, see the following snippet as annotated from Callgrind. GCC compiled with -O2 -march=i586, HOST_WIDE_INT is 8 bytes. . static unsigned int . _sprint_uw_rev (char *s, unsigned HOST_WIDE_INT value) . { 21,838 unsigned int i = 0; 177,348 do . { 709,392 s[i] = "0123456789"[value % 10]; 2,748,894 => libgcc2.c:__umoddi3 (88674x) 709,392 value /= 10; 2,216,850 => libgcc2.c:__udivdi3 (88674x) 244,184 i++; . } . while (value != 0); . return i; . }