https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79953
Bug ID: 79953
Summary: ICE in expand_debug_locations when attribute target is
used
Product: gcc
Version: 6.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: debug
Assignee: unassigned at gcc dot gnu.org
Reporter: dmarion at me dot com
Target Milestone: ---
$ gcc -march=nehalem -O3 -o a.o a.c -c -g2 -Wall -Wextra
a.c: In function ‘foo_avx2’:
a.c:15:38: internal compiler error: in expand_debug_locations, at
cfgexpand.c:5304
void __attribute__((target("avx2"))) foo_avx2(void *dst, void *src) {
$ cat a.c
typedef unsigned char u8;
typedef u8 u8x32 __attribute__((vector_size(32)));
static inline void __attribute__((always_inline))
foo(void *dst, void *src) {
u8x32 x;
u8x32 *ps = (u8x32 *)src;
u8x32 *pd = (u8x32 *)dst;
//*pd = *ps;
x = *ps;
*pd = x;
}
void __attribute__((target("avx2"))) foo_avx2(void *dst, void *src) {
foo(dst, src);
}
Comments:
1. Observed in different gcc version including 7.0 snapshot
2. It doesn't happen with -g1
3. It doesn't happen when vector variable is not used, uncomment "*pd = *ps;"
in the code above, comment out "u8x32 x;" and further references to x.