public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug d/114171] New: [13/14 Regression] gdc -O2 -mavx generates misaligned vmovdqa instruction
@ 2024-02-29 15:53 a.horodniceanu at proton dot me
  2024-03-01  4:59 ` [Bug d/114171] " pinskia at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: a.horodniceanu at proton dot me @ 2024-02-29 15:53 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 114171
           Summary: [13/14 Regression] gdc -O2 -mavx generates misaligned
                    vmovdqa instruction
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: d
          Assignee: ibuclaw at gdcproject dot org
          Reporter: a.horodniceanu at proton dot me
  Target Milestone: ---

I've hit this initially in the tests of D-Scanner but I've reduced it to:
---
struct Token {
        string label;
}

interface ASTNode {}

abstract class BaseNode : ASTNode {}

final class BreakStatement : BaseNode {
        Token label;
}

int main () {
        auto bn = new BreakStatement();
        return bn.label is Token.init;
}
---

Compiled with `gdc -O2 -mavx a.d -o a` it segfaults at runtime.

gdb shows the following assembly:
---
   0x25520 <_Dmain>:    sub    $0x8,%rsp
   0x25524 <_Dmain+4>:  call   0x254b0
<_D4core8lifetime__T12_d_newclassTTC1a14BreakStatementZQBjFNaNbNeZQBf>
   0x25529 <_Dmain+9>:  vmovdqa 0x18(%rax),%xmm0
---
The issue is with vmovdqa which expected the memory to be 16-byte aligned but
it is only 8-byte.

I've tested with gdc 13 and 14 with the exact versions:
---
Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/14/gdc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/14/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-14.0.9999/work/gcc-14.0.9999/configure
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/14
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/14/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/14
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/14/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/14/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14
--disable-silent-rules --disable-dependency-tracking
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/14/python
--enable-languages=c,c++,d,objc,fortran --enable-obsolete --enable-secureplt
--disable-werror --with-system-zlib --enable-nls --without-included-gettext
--disable-libunwind-exceptions --enable-checking=yes,extra
--with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo Hardened
14.0.9999 p, commit e54a7fbca63053b5753fd9ba543c27ef392d3084'
--with-gcc-major-version-only --enable-libstdcxx-time --enable-lto
--disable-libstdcxx-pch --enable-shared --enable-threads=posix
--enable-__cxa_atexit --enable-clocale=gnu --enable-multilib
--with-multilib-list=m32,m64 --disable-fixed-point --enable-targets=all
--enable-libgomp --disable-libssp --disable-libada --enable-cet
--disable-systemtap --disable-valgrind-annotations --disable-vtable-verify
--disable-libvtv --without-zstd --without-isl --enable-default-pie
--enable-host-pie --enable-host-bind-now --enable-default-ssp
--disable-fixincludes --with-build-config=bootstrap-cet
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.1 20240219 (experimental)
3a6f3354eaaf38b5e6be41e4ebf521d299593a6e (Gentoo Hardened 14.0.9999 p, commit
e54a7fbca63053b5753fd9ba543c27ef392d3084)
---
and
---
Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/13/gdc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/13/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-13.2.1_p20240113-r1/work/gcc-13-20240113/configure
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/13
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/13/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/13
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/13/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/13/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13
--disable-silent-rules --disable-dependency-tracking
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/13/python
--enable-languages=c,c++,d,objc,fortran --enable-obsolete --enable-secureplt
--disable-werror --with-system-zlib --enable-nls --without-included-gettext
--disable-libunwind-exceptions --enable-checking=release
--with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo Hardened
13.2.1_p20240113-r1 p12' --with-gcc-major-version-only --enable-libstdcxx-time
--enable-lto --disable-libstdcxx-pch --enable-shared --enable-threads=posix
--enable-__cxa_atexit --enable-clocale=gnu --enable-multilib
--with-multilib-list=m32,m64 --disable-fixed-point --enable-targets=all
--enable-libgomp --disable-libssp --disable-libada --enable-cet
--disable-systemtap --disable-valgrind-annotations --disable-vtable-verify
--disable-libvtv --without-zstd --without-isl --enable-default-pie
--enable-default-ssp --with-build-config=bootstrap-cet
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 13.2.1 20240113 (Gentoo Hardened 13.2.1_p20240113-r1 p12)
---

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-03-03  1:39 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-29 15:53 [Bug d/114171] New: [13/14 Regression] gdc -O2 -mavx generates misaligned vmovdqa instruction a.horodniceanu at proton dot me
2024-03-01  4:59 ` [Bug d/114171] " pinskia at gcc dot gnu.org
2024-03-01  6:28 ` liuhongt at gcc dot gnu.org
2024-03-01  7:05 ` rguenth at gcc dot gnu.org
2024-03-01  8:38 ` a.horodniceanu at proton dot me
2024-03-01 13:25 ` ibuclaw at gdcproject dot org
2024-03-01 13:37 ` rguenth at gcc dot gnu.org
2024-03-01 14:13 ` ibuclaw at gdcproject dot org
2024-03-03  1:33 ` cvs-commit at gcc dot gnu.org
2024-03-03  1:35 ` cvs-commit at gcc dot gnu.org
2024-03-03  1:37 ` cvs-commit at gcc dot gnu.org
2024-03-03  1:39 ` cvs-commit at gcc dot gnu.org
2024-03-03  1:39 ` ibuclaw at gdcproject dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).