https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121605
Bug ID: 121605
Summary: [ICE] internal compiler error: verify_gimple failed
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: njuwy at smail dot nju.edu.cn
Target Milestone: ---
Compiler Explorer: https://godbolt.org/z/nrjqex1cM
The crash triggering program (compile with `gcc-16 -O1`):
```
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
void process_ptr(const nullptr_t np, int* ptr, int val) {
static int counter = 0;
if (!ptr) {
if (np == nullptr) {
counter += val;
do {
switch (counter % 3) {
case 0:
if (val > 0 ? --val : ++val) break;
case 1:
while (val-- > 0) {
if (val % 2) continue;
else if (counter++ > 10) goto end;
}
break;
default:
for (int i = 0; i < 2; ++i) {
counter += (i + 1) * val;
}
break;
}
} while ((val || --counter) && counter < 15);
}
}
end:
printf("Counter: %d\n", counter);
}
int main(void) {
process_ptr(nullptr, (int*)nullptr, 5);
return EXIT_SUCCESS;
}
```
The crash output:
```
<source>: In function 'process_ptr':
<source>:4:6: error: invalid types in nop conversion
4 | void process_ptr(const nullptr_t np, int* ptr, int val) {
| ^~~~~~~~~~~
unsigned long
<<< Unknown tree: nullptr_type >>>
_45 = (unsigned long) np_30(D);
during GIMPLE pass: reassoc
<source>:4:6: internal compiler error: verify_gimple failed
0x2558e65 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
???:0
0x254e486 internal_error(char const*, ...)
???:0
0x11fddae verify_gimple_in_cfg(function*, 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.
Compiler returned: 1
```