https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61373
Bug ID: 61373 Summary: neon registers restored incorrectly with -mapcs-frame -O -fno-omit-frame-pointer Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: breiten at lexmark dot com The attached file is a preprocessed and stripped version of: http://cgit.freedesktop.org/systemd/systemd/plain/src/shared/siphash24.c When compiled with -O -march=armv7-a -mfpu=neon -mapcs-frame -fno-omit-frame-pointer, the neon registers are restored incorrectly. The are stored to the stack with: fstmfdd sp!, {d8, d9, d10, d11} fstmfdd sp!, {d14} but restored [out of order] with: fldmfdd ip!, {d8-d11} fldmfdd ip!, {d14} This does not occur at -O0 or -O2 or without -mapcs-frame. With -fno-omit-frame-pointer removed, the two fldmfdd instructions are swapped and appear correct. This occurs on both 4.8.1 (as patched by poky-1.5) and 4.8.3. Here's my gcc version: Using built-in specs. COLLECT_GCC=/bonus/scratch/gcc483/poky/myproject/tmp/sysroots/x86_64-linux/usr/bin/armv7a-vfp-neon-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc COLLECT_LTO_WRAPPER=/bonus/scratch/gcc483/poky/myproject/tmp/sysroots/x86_64-linux/usr/libexec/armv7a-vfp-neon-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.8.3/lto-wrapper Target: arm-poky-linux-gnueabi Configured with: /bonus/scratch/gcc483/poky/myproject/tmp/work-shared/gcc-4.8.3-r0/gcc-4.8.3/configure --build=x86_64-linux --host=x86_64-linux --target=arm-poky-linux-gnueabi --prefix=/bonus/scratch/gcc483/poky/myproject/tmp/sysroots/x86_64-linux/usr --exec_prefix=/bonus/scratch/gcc483/poky/myproject/tmp/sysroots/x86_64-linux/usr --bindir=/bonus/scratch/gcc483/poky/myproject/tmp/sysroots/x86_64-linux/usr/bin/armv7a-vfp-neon-poky-linux-gnueabi --sbindir=/bonus/scratch/gcc483/poky/myproject/tmp/sysroots/x86_64-linux/usr/bin/armv7a-vfp-neon-poky-linux-gnueabi --libexecdir=/bonus/scratch/gcc483/poky/myproject/tmp/sysroots/x86_64-linux/usr/libexec/armv7a-vfp-neon-poky-linux-gnueabi --datadir=/bonus/scratch/gcc483/poky/myproject/tmp/sysroots/x86_64-linux/usr/share --sysconfdir=/bonus/scratch/gcc483/poky/myproject/tmp/sysroots/x86_64-linux/etc --sharedstatedir=/bonus/scratch/gcc483/poky/myproject/tmp/sysroots/x86_64-linux/com --localstatedir=/bonus/scratch/gcc483/poky/myproject/tmp/sysroots/x86_64-linux/var --libdir=/bonus/scratch/gcc483/poky/myproject/tmp/sysroots/x86_64-linux/usr/lib/armv7a-vfp-neon-poky-linux-gnueabi --includedir=/bonus/scratch/gcc483/poky/myproject/tmp/sysroots/x86_64-linux/usr/include --oldincludedir=/bonus/scratch/gcc483/poky/myproject/tmp/sysroots/x86_64-linux/usr/include --infodir=/bonus/scratch/gcc483/poky/myproject/tmp/sysroots/x86_64-linux/usr/share/info --mandir=/bonus/scratch/gcc483/poky/myproject/tmp/sysroots/x86_64-linux/usr/share/man --disable-silent-rules --disable-dependency-tracking --with-libtool-sysroot=/bonus/scratch/gcc483/poky/myproject/tmp/sysroots/x86_64-linux --enable-clocale=generic --with-gnu-ld --enable-shared --enable-languages=c,c++ --enable-threads=posix --disable-multilib --enable-c99 --enable-long-long --enable-symvers=gnu --enable-libstdcxx-pch --program-prefix=arm-poky-linux-gnueabi- --without-local-prefix --enable-target-optspace --enable-lto --enable-libssp --disable-bootstrap --disable-libmudflap --with-system-zlib --with-linker-hash-style=gnu --enable-linker-build-id --with-ppl=no --with-cloog=no --enable-checking=release --enable-cheaders=c_global --with-gxx-include-dir=/bonus/scratch/gcc483/poky/myproject/tmp/sysroots/myarmcpu/usr/include/c++ --with-sysroot=/bonus/scratch/gcc483/poky/myproject/tmp/sysroots/myarmcpu --with-build-sysroot=/bonus/scratch/gcc483/poky/myproject/tmp/sysroots/myarmcpu --enable-poison-system-directories --disable-libunwind-exceptions --with-mpfr=/bonus/scratch/gcc483/poky/myproject/tmp/sysroots/x86_64-linux/usr --with-system-zlib --disable-nls Thread model: posix gcc version 4.8.3 (GCC)