[Bug target/95134] Add a target option to avoid libcall

hjl.tools at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu May 14 20:21:28 GMT 2020


H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
         Resolution|WONTFIX                     |---
             Status|RESOLVED                    |NEW
           Assignee|unassigned at gcc dot gnu.org      |hjl.tools at gmail dot com

--- Comment #5 from H.J. Lu <hjl.tools at gmail dot com> ---
Created attachment 48538
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48538&action=edit
A patch to add -mavoid-libcall

The -mgeneral-regs-only option generates code that uses only the
general-purpose registers.  It prevents the compiler from using vector
registers.  But GCC may still generate calls to memcpy, memmove, memset
and memcmp library functions.  In the GNU C library, these library
functions are implementated with vector registers, which makes the
-mgeneral-regs-only option less effective.  The new -mavoid-libcall
option expands memcpy, memmove and memset into REP MOVSB and REP STOSB
sequence.  This option can be further enhanced with a cmpmem pattern
to expand memcmp into REP CMPSB sequence in the future.

More information about the Gcc-bugs mailing list