https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100791
Bug ID: 100791
Summary: ICE: verify_gimple failed
Product: gcc
Version: tree-ssa
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: cnsun at uwaterloo dot ca
Target Milestone: ---
$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/scratch/software/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /tmp/tmp.SQC1E9RsGE-gcc-builder/gcc/configure
--enable-languages=c,c++,lto --enable-checking-yes --enable-multiarch
--prefix=/scratch/software/gcc-trunk --disable-bootstrap
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.0.0 20210527 (experimental) [master revision
:d03f010a0:01c59ef2e5a59b44d2b662361196abb6be872a20] (GCC)
$ cat mutant.c
__attribute__((__always_inline__)) sprintf() {
return log_bad_request(0, __builtin_va_arg_pack());
}
void log_bad_request() { sprintf(0); }
$ gcc-trunk mutant.c
mutant.c:1:36: warning: return type defaults to ‘int’ [-Wimplicit-int]
1 | __attribute__((__always_inline__)) sprintf() {
| ^~~~~~~
mutant.c:1:36: warning: conflicting types for built-in function ‘sprintf’;
expected ‘int(char *, const char *, ...)’ [-Wbuiltin-declaration-mismatch]
mutant.c:1:1: note: ‘sprintf’ is declared in header ‘<stdio.h>’
+++ |+#include <stdio.h>
1 | __attribute__((__always_inline__)) sprintf() {
mutant.c: In function ‘sprintf’:
mutant.c:1:36: warning: number of arguments doesn’t match built-in prototype
1 | __attribute__((__always_inline__)) sprintf() {
| ^~~~~~~
mutant.c:2:10: warning: implicit declaration of function ‘log_bad_request’
[-Wimplicit-function-declaration]
2 | return log_bad_request(0, __builtin_va_arg_pack());
| ^~~~~~~~~~~~~~~
mutant.c: At top level:
mutant.c:4:6: warning: conflicting types for ‘log_bad_request’; have ‘void()’
4 | void log_bad_request() { sprintf(0); }
| ^~~~~~~~~~~~~~~
mutant.c:2:10: note: previous implicit declaration of ‘log_bad_request’ with
type ‘void()’
2 | return log_bad_request(0, __builtin_va_arg_pack());
| ^~~~~~~~~~~~~~~
mutant.c:1:36: warning: ‘always_inline’ function might not be inlinable
[-Wattributes]
1 | __attribute__((__always_inline__)) sprintf() {
| ^~~~~~~
mutant.c: In function ‘log_bad_request’:
mutant.c:4:1: error: invalid conversion in gimple call
4 | void log_bad_request() { sprintf(0); }
| ^~~~
int
void
# .MEM_4 = VDEF <.MEM_1(D)>
_3 = log_bad_request (0, 0);
during GIMPLE pass: einline
mutant.c:4:1: internal compiler error: verify_gimple failed
0xf77e71 verify_gimple_in_cfg(function*, bool)
/tmp/tmp.SQC1E9RsGE-gcc-builder/gcc/gcc/tree-cfg.c:5509
0xe24f6f execute_function_todo
/tmp/tmp.SQC1E9RsGE-gcc-builder/gcc/gcc/passes.c:2042
0xe25d5e execute_todo
/tmp/tmp.SQC1E9RsGE-gcc-builder/gcc/gcc/passes.c:2096
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.