https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121189

            Bug ID: 121189
           Summary: ICE: Segmentation fault with target_clones and
                    vector_size attribute
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

When compile this program, GCC crashes:
```
__attribute__((target_clones("avx2,default"), vector_size(32))) double
a(){}
```

Complier Explorer: https://gcc.godbolt.org/z/vEnjErvhe

The full stack dump:
```
mutant.c: In function 'a':
mutant.c:2:1: warning: AVX vector return without AVX enabled changes the ABI
[-Wpsabi]
    2 | a(){}
      | ^
during RTL pass: expand
mutant.c: In function 'a.avx2':
mutant.c:2:5: internal compiler error: Segmentation fault
    2 | a(){}
      |     ^
0x5554b38 internal_error(char const*, ...)
        ../../gcc/gcc/diagnostic-global-context.cc:517
0x21651ec crash_signal
        ../../gcc/gcc/toplev.cc:321
0x1616a40 convert_memory_address_addr_space_1(scalar_int_mode, rtx_def*,
unsigned char, bool, bool)
        ../../gcc/gcc/explow.cc:310
0x16174c5 convert_memory_address_addr_space(scalar_int_mode, rtx_def*, unsigned
char)
        ../../gcc/gcc/explow.cc:429
0x17a0d4b expand_function_end()
        ../../gcc/gcc/function.cc:5575
0x1374bef construct_exit_block
        ../../gcc/gcc/cfgexpand.cc:6621
0x1378dd7 execute
        ../../gcc/gcc/cfgexpand.cc:7276
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
```

Reply via email to