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 target/56199] New: strcpy/strcat builtins generates suboptimal code.


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56199

             Bug #: 56199
           Summary: strcpy/strcat builtins generates suboptimal code.
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: neleai@seznam.cz


Current strcpy/strcat generates code in form 

movabsq $7954893459765158241, %r11
movq %r11,(%rax)
...

Which is slower than copying string from memory using

movq (%rdx),%r11
movq %r11,(%rax)
...

Attached benchmark is 50% faster on sandy bridge for 70 byte string.

Note that icc also translates strcpy into this form(but not strcat for some
reason.)


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