8000 GCC assembly bug in AVX-512 instructions on Cygwin · Issue #16290 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content
GCC assembly bug in AVX-512 instructions on Cygwin #16290
Closed
@embray

Description

@embray

I encountered this issue at build time while testing #16246 on a Haswell-based CPU supporting AVX2.

This is due to a confirmed bug in GCC that is fixed since GCC 8.4: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65782

One suggested workaround on Stack Overflow was to pass a number of -ffixed-<reg> flags to prevent GCC from producing code using the unsupported registers:

-ffixed-xmm16 -ffixed-xmm17 -ffixed-xmm18 -ffixed-xmm19
-ffixed-xmm20 -ffixed-xmm21 -ffixed-xmm22 -ffixed-xmm23
-ffixed-xmm24 -ffixed-xmm25 -ffixed-xmm26 -ffixed-xmm27
-ffixed-xmm28 -ffixed-xmm29 -ffixed-xmm30 -ffixed-xmm31

I found that this workaround worked for me. So a possible workaround in Numpy would be to automatically add these flags to CFLAGS, at least on Cygwin and GCC < 8.4 (does Numpy's build system have an existing routine to check the compiler version?)

Error message:

numpy/core/src/umath/loops.c.src:3058:1: warning: AVX512F vector return without AVX512F enabled changes the ABI [-Wpsabi]
 }
 ^
numpy/core/src/umath/loops.c.src:3058:1: warning: AVX vector return without AVX enabled changes the ABI [-Wpsabi]
{standard input}: Assembler messages:
{standard input}:9023: Error: invalid register for .seh_savexmm
{standard input}:9025: Error: invalid register for .seh_savexmm
{standard input}:9027: Error: invalid register for .seh_savexmm
... several more similar lines ...

Numpy/Python version information:

1.20.0.dev0+7f7d19d 3.6.8 (default, Feb 14 2019, 22:09:48)
[GCC 7.4.0]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0