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

            Bug ID: 111914
           Summary: GCC: 14: ICE when function pointer array as arguments
           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: ---

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

When compile this program with `-O0`, gcc crashes:
```
 __attribute__((always_inline))
void f(int n, int (*a())[n]) {
}

void g(void)
{
  int (*a())[1];
  f(1, a);
}

```

Interestingly, `-O1` or above do not trigger the crash.

The full stack dump:
```
<source>:2:6: warning: 'always_inline' function might not be inlinable
[-Wattributes]
    2 | void f(int n, int (*a())[n]) {
      |      ^
<source>: In function 'g':
<source>:9:1: error: type mismatch between an SSA_NAME and its symbol
    9 | }
      | ^
<source>:9:1: error: type mismatch between an SSA_NAME and its symbol
while verifying SSA_NAME a_4 in statement
a_4 = a;
during GIMPLE pass: einline
<source>:9:1: internal compiler error: verify_ssa failed
0x231f49e internal_error(char const*, ...)
        ???:0
0x139c15e verify_ssa(bool, bool)
        ???: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