https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69616

            Bug ID: 69616
           Summary: optimization of 8 movb
           Product: gcc
           Version: 5.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: izaberina at gmail dot com
  Target Milestone: ---

I'm on arch linux on x86_64, using gcc 5.3.0.
From this code:

char tape[65536];
void f() {
    tape[0] = 0;
    tape[1] = 0;
    tape[2] = 0;
    tape[3] = 0;
    tape[4] = 0;
    tape[5] = 0;
    tape[6] = 0;
    tape[7] = 0;
}

gcc produces 8 movb at any -O level, while clang produces 1 movq.

Why is that not being optimized?

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /build/gcc/src/gcc-5.3.0/configure --prefix=/usr
--libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/
--enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared
--enable-threads=posix --enable-libmpx --with-system-zlib --with-isl
--enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu
--disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object
--enable-linker-build-id --enable-lto --enable-plugin
--enable-install-libiberty --with-linker-hash-style=gnu
--enable-gnu-indirect-function --disable-multilib --disable-werror
--enable-checking=release
Thread model: posix
gcc version 5.3.0 (GCC)

Reply via email to