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

            Bug ID: 111856
           Summary: GCC: 14: internal compiler error: in as_a, at
                    machmode.h:381
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: 141242068 at smail dot nju.edu.cn
  Target Milestone: ---

When compile this program with option `-fopenmp-simd`, gcc crashes:
```
typedef void T;

int array[1000];
#pragma omp declare simd notinbranch simdlen(4)
T foo (int i)
{
  array[i] = 555;
}
```

Compiler Explorer: https://gcc.godbolt.org/z/Tq665jvzP

Interestingly, by bypassing the `typedef` and directly defining foo's return
type as void, the crash disappears:
```
int array[1000];
#pragma omp declare simd notinbranch simdlen(4)
void foo (int i)
{
  array[i] = 555;
}
```

The stack dump:
```
during IPA pass: simdclone
<source>: In function 'foo.simdclone.0':
<source>:8:1: internal compiler error: in as_a, at machmode.h:381
    8 | }
      | ^
0x230ff8e internal_error(char const*, ...)
        ???:0
0x9fe390 fancy_abort(char const*, int, char const*)
        ???:0
0x1fa0c9f expand_simd_clones(cgraph_node*)
        ???:0
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