Bug#916939: gcc-6: target_clones with AVX512f and -g2 gives internal compiler error
Package: gcc-6
Version: 6.3.0-18+deb9u1
Severity: minor
Dear Maintainer,
* What led up to the situation?
While writing SIMD code, gcc gave me the following error message:
cc-error.c: In function ‘f.avx512f.0’:
cc-error.c:3:1: internal compiler error: in expand_debug_locations, at cfgexpand.c:5304
f(void)
A reduced test case:
__attribute__((target_clones ("avx512f", "default")))
void
f(void)
{
__attribute__((vector_size (64))) unsigned long int v
= { 0, 0, 0, 0, 0, 0, 0, 0 };
}
To be compiled as follows, on x86-64:
gcc -g2 -O1 -c cc-error.c
* Reproducing the bug in other situations
At least -g2 and -O1 are necessary .
g++ or gcc: doesn't matter.
Adding -mavx512f to the command line stops the error!
The target_clones attribute it necessary.
Replacing avx512f by avx2 does not reproduce the error.
Removing the vector variable does not reproduce the error.
The vector must be at least 32 bytes.
short and int also reproduce the error.
x86_64-w64-mingw32-gcc also produces the error.
* What was the outcome of this action?
Interesting information:
- -g2 debugging information is required
- the function must be cloned
(-mavx512f tells GCC: avx512f will always be available.
In that case, no clone is necessary.)
- avx512f, not avx2
* What outcome did you expect instead?
A compiled function that does nothing.
* Work-arounds
Don't use AVX-512, or compile with minimal debug information (-g0 or -g1).
-- System Information:
Debian Release: 9.6
APT prefers stable
APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 4.9.0-8-amd64 (SMP w/8 CPU cores)
Locale: LANG=nl_BE.UTF-8, LC_CTYPE=nl_BE.UTF-8 (charmap=UTF-8), LANGUAGE=nl_BE:nl (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages gcc-6 depends on:
ii binutils 2.28-5
ii cpp-6 6.3.0-18+deb9u1
ii gcc-6-base 6.3.0-18+deb9u1
ii libc6 2.24-11+deb9u3
ii libcc1-0 6.3.0-18+deb9u1
ii libgcc-6-dev 6.3.0-18+deb9u1
ii libgcc1 1:6.3.0-18+deb9u1
ii libgmp10 2:6.1.2+dfsg-1
ii libisl15 0.18-1
ii libmpc3 1.0.3-1+b2
ii libmpfr4 3.1.5-1
ii libstdc++6 6.3.0-18+deb9u1
ii zlib1g 1:1.2.8.dfsg-5
Versions of packages gcc-6 recommends:
ii libc6-dev 2.24-11+deb9u3
Versions of packages gcc-6 suggests:
pn gcc-6-doc <none>
pn gcc-6-locales <none>
pn gcc-6-multilib <none>
pn libasan3-dbg <none>
pn libatomic1-dbg <none>
pn libcilkrts5-dbg <none>
pn libgcc1-dbg <none>
pn libgomp1-dbg <none>
pn libitm1-dbg <none>
pn liblsan0-dbg <none>
pn libmpx2-dbg <none>
pn libquadmath0-dbg <none>
pn libtsan0-dbg <none>
pn libubsan0-dbg <none>
-- no debconf information
Reply to: