http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60831

            Bug ID: 60831
           Summary: gcc-4.8.2 creates binaries with broken AVX support
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mmokrejs at gmail dot com

Created attachment 32588
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32588&action=edit
Original python code

Hi,
  I have a code written in python and converting it to C using cython I can
compile it using gcc. When I use -mavx the binary crashes. I will attach all of
files.

$ cython --embed --no-docstrings -2 PyFloat_crash.py

$ gcc -ggdb -pipe -mpclmul -mpopcnt -mavx -march=native
-I/usr/include/python2.7 -o PyFloat_crash -lpython2.7 PyFloat_crash.c

$ ./PyFloat_crash 
Illegal instruction (core dumped)
$

$ gdb PyFloat_crash ./core
GNU gdb (Gentoo 7.6.2 p1) 7.6.2
...
This GDB was configured as "x86_64-pc-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.gentoo.org/>...
Reading symbols from PyFloat_crash...done.
[New LWP 21206]

warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `./PyFloat_crash'.
Program terminated with signal 4, Illegal instruction.
#0  0x00000000004021e9 in initPyFloat_crash () at PyFloat_crash.c:910
910       __pyx_t_2 = PyFloat_FromDouble(0.00001); if (unlikely(!__pyx_t_2))
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto
__pyx_L1_error;}
(gdb) where
#0  0x00000000004021e9 in initPyFloat_crash () at PyFloat_crash.c:910
#1  0x000000000040277e in main (argc=1, argv=0x7fff242db938) at
PyFloat_crash.c:1040
(gdb) bt full
#0  0x00000000004021e9 in initPyFloat_crash () at PyFloat_crash.c:910
        __pyx_t_1 = <instancemethod at remote 0x7fa11f2f1aa0>
        __pyx_t_2 = 0x0
Python Exception <class 'gdb.error'> There is no member named ma_mask.: 
        __pyx_t_3 = 
        __pyx_t_4 = 0x0
        __pyx_lineno = 0
        __pyx_filename = 0x0
        __pyx_clineno = 0
#1  0x000000000040277e in main (argc=1, argv=0x7fff242db938) at
PyFloat_crash.c:1040
        m = 0x0
(gdb)

$ gcc -v
Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.2/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.8.2/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/configure
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.2
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.2
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.2/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.2/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/include/g++-v4
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.8.2/python
--enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt
--disable-werror --with-system-zlib --enable-nls --without-included-gettext
--enable-checking=release --with-bugurl=https://bugs.gentoo.org/
--with-pkgversion='Gentoo 4.8.2 p1.3r1, pie-0.5.8r1' --enable-libstdcxx-time
--enable-shared --enable-threads=posix --enable-__cxa_atexit
--enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64
--disable-altivec --disable-fixed-point --enable-targets=all --disable-libgcj
--enable-libgomp --disable-libmudflap --disable-libssp --enable-lto
--without-cloog
Thread model: posix
gcc version 4.8.2 (Gentoo 4.8.2 p1.3r1, pie-0.5.8r1) 
$

$ cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 44
model name      : Intel(R) Xeon(R) CPU           X5680  @ 3.33GHz
stepping        : 2
microcode       : 0x14
cpu MHz         : 3334.000
cache size      : 12288 KB
physical id     : 1
siblings        : 6
core id         : 10
cpu cores       : 6
apicid          : 52
initial apicid  : 52
fpu             : yes
fpu_exception   : yes
cpuid level     : 11
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb
rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology
nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2
ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 popcnt aes lahf_lm ida arat epb
dtherm tpr_shadow vnmi flexpriority ept vpid
bogomips        : 6649.95
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:



If I omit the "-mavx" from gcc arguments, the binary works.

$ cython -V
Cython version 0.19.1
$

Reply via email to