This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug rtl-optimization/54183] New: Generate __udivmoddi4 instead of __udivdi3 plus __umoddi3


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: unassigned@gcc.gnu.org
        ReportedBy: jimis@gmx.net
                CC: abel@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;
        .  }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]