[Bug c/53485] gcc -O -mavx generates illegal instruction on win64
hjl.tools at gmail dot com
gcc-bugzilla@gcc.gnu.org
Fri May 25 15:54:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53485
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |hjl.tools at gmail dot com
--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> 2012-05-25 15:49:05 UTC ---
(In reply to comment #0)
> Created attachment 27495 [details]
> preprocessed source
>
> Compiling the attached program with optimization and AVX for Win64 generates an
> illegal instruction. The same code runs correctly on Win32 and on Linux64.
>
> $ x86_64-w64-mingw32-gcc -m64 -mavx bug.c -O -g -o bug.exe -Wall -Wextra
> -save-temps
> $ ./bug.exe
> BUG PROGRAM START: We should get this message once.
> DEBUG fun1 start...
> Illegal instruction
> $ gdb bug.exe
> (gdb) r
> Starting program: C:\cygwin\home\nas/bug.exe
> [New Thread 2436.0x38c]
> BUG PROGRAM START: We should get this message once.
> DEBUG fun1 start...
>
> Program received signal SIGILL, Illegal instruction.
> fun1 () at bug.c:95
> 95 v1 = vfone;
> (gdb) x/i $pc
> => 0x4015e7 <fun1+54>: vmovaps 0x7b11(%rip),%ymm0 # 0x409100
> (gdb) p $rip
> $1 = (void (*)()) 0x4015e7 <fun1+54>
> (gdb) info frame
> Stack level 0, frame at 0x22fe40:
> rip = 0x4015e7 in fun1 (bug.c:95); saved rip 0x40171b
It looks like 0x7b11(%rip) isn't aligned to 16 byte.
More information about the Gcc-bugs
mailing list