https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96532
Bug ID: 96532
Summary: [m68k] gcc 10.x generates calls to memset even for
very small amounts
Product: gcc
Version: 10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: [email protected]
Target Milestone: ---
Created attachment 49028
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49028&action=edit
Sample program
Starting with gcc 10.x, the attached small sample generates library calls to
memset, although it could determine that at most 4 bytes have to be set.
The compiler was generated from a vanilla releases/gcc-10 branch, with a
configuration of:
configure --target=m68k-elf '--prefix=/usr' '--libdir=/usr/lib64'
'--bindir=/usr/bin' '--libexecdir=${libdir}' 'CFLAGS_FOR_BUILD=-O2
-fomit-frame-pointer' 'CFLAGS=-O2 -fomit-frame-pointer' 'CXXFLAGS_FOR_BUILD=-O2
-fomit-frame-pointer' 'CXXFLAGS=-O2 -fomit-frame-pointer' 'BOOT_CFLAGS=-O2
-fomit-frame-pointer' 'CFLAGS_FOR_TARGET=-O2 -fomit-frame-pointer'
'CXXFLAGS_FOR_TARGET=-O2 -fomit-frame-pointer' 'LDFLAGS_FOR_BUILD=' 'LDFLAGS='
'--disable-libvtv' '--disable-libmpx' '--disable-libcc1' '--disable-werror'
'--with-gxx-include-dir=/usr/m68k-elf/sys-root/usr/include/c++/10'
'--with-default-libstdcxx-abi=gcc4-compatible' '--with-gcc-major-version-only'
'--with-gcc' '--with-gnu-as' '--with-gnu-ld' '--with-system-zlib'
'--disable-libgomp' '--without-newlib' '--disable-libstdcxx-pch'
'--disable-threads' '--disable-win32-registry' '--disable-lto' '--enable-ssp'
'--enable-libssp' '--disable-plugin' '--disable-decimal-float' '--disable-nls'
'--with-libiconv-prefix=/usr' '--with-libintl-prefix=/usr'
'--with-sysroot=/usr/m68k-elf/sys-root' 'CC=gcc' 'CXX=g++'
'--enable-languages=c'
Attached are the sample, the assembler output produced by gcc 10, and also the
assembler output of gcc-7.1.0