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

Jeffrey Walton <noloader at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |noloader at gmail dot com

--- Comment #16 from Jeffrey Walton <noloader at gmail dot com> ---
(In reply to Jaroslav Fojtík from comment #3)
> It seems to me that this problem has something to do with memcpy optimised
> for AVX, that newly requests everything to be aligned.

Speaking from experience, when you encounter a problem with alignment when
using SSE/AVX, then you receive a bus error (SIGBUS), not a segfault (SIGSEGV),

If I am parsing the output below correctly, at frame #1, f=0x55555555a6b0 is
aligned to 16-bytes. I don't believe there is an alignment problem.

> ------------------------------------------------------
> 
> <<<struct>>> (c)1998-2024 Jaroslav Fojtik
>                  This program tests the struct.c library
> ***LO_ENDIAN defined***
> ***NATIVE access***
>  Testing struct manipulation
> 
> Program received signal SIGSEGV, Segmentation fault.
> __memcpy_avx_unaligned ()
>     at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:220
> warning: 220    ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S: No
> such file or directory
> (gdb)
> (gdb) backtrace
> #0  __memcpy_avx_unaligned () at
> ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:220
> #1  0x00007ffff7e41ce7 in _IO_new_file_xsputn (n=423, data=0xd,
> f=0x55555555a6b0) at ./libio/fileops.c:1236
> #2  _IO_new_file_xsputn (f=0x55555555a6b0, data=0xd, n=423) at
> ./libio/fileops.c:1197
> #3  0x00007ffff7e35d6e in __GI__IO_fwrite (buf=0xd, size=size@entry=1,
> count=423, fp=fp@entry=0x55555555a6b0)
>     at ./libio/libioP.h:1030
> #4  0x000055555555608d in savestruct (F=0x55555555a6b0,
> description=0x555555557767 <StructTopol+23> "3",
>     description@entry=0x555555557750 <StructTopol>
> "a20wwwdwwwqqqqqwwddba423") at struct.c:486
> #5  0x000055555555635e in SaveTopolHeader (f=<optimized out>,
> SU=SU@entry=0x7fffffffe100) at mintest.c:50
> #6  0x00005555555552bd in main (argc=<optimized out>, argv=<optimized out>)
> at mintest.c:143
> (gdb)

Reply via email to