https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117489
Bug ID: 117489
Summary: ICE on x86_64-linux-gnu: in handle_call_arg, at
tree-ssa-structalias.cc:4226 at -O1 and above with
"-fno-ipa-pure-const" and no sanitize attribute
Product: gcc
Version: 15.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: ipa
Assignee: unassigned at gcc dot gnu.org
Reporter: iamanonymous.cs at gmail dot com
Target Milestone: ---
Compiler Explorer: https://godbolt.org/z/WbsoPKv9G
*******************************************************************************
gcc version:
Using built-in specs.
COLLECT_GCC=/home/software/gcc-trunk/bin/gcc
COLLECT_LTO_WRAPPER=/home/software/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --disable-bootstrap --enable-checking=yes
--prefix=/home/software/gcc-trunk --enable-sanitizers --enable-languages=c,c++
--disable-werror --enable-multilib --enable-coverage
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20241107 (experimental) (GCC)
*******************************************************************************
Program:
$ cat mutant.C
class a {
virtual a c();
};
class B {
virtual B *d();
};
class e : a, B {
e *__attribute__((no_sanitize("undefined"))) __attribute__((pure)) d() {
return this;
}
};
int main() { e b; }
*******************************************************************************
Command Lines:
$ gcc -O1 -fno-ipa-pure-const -fsanitize=undefined mutant.C
during GIMPLE pass: ealias
mutant.C: In member function 'virtual e* e::_ZTch0_h8_N1e1dEv()':
mutant.C:12:19: internal compiler error: in handle_call_arg, at
tree-ssa-structalias.cc:4226
12 | int main() { e b; }
| ^
0x5cdf4f4 internal_error(char const*, ...)
../../gcc/gcc/diagnostic-global-context.cc:518
0x5c807b6 fancy_abort(char const*, int, char const*)
../../gcc/gcc/diagnostic.cc:1696
0x2bdb65a handle_call_arg
../../gcc/gcc/tree-ssa-structalias.cc:4226
0x2bdc3aa handle_rhs_call
../../gcc/gcc/tree-ssa-structalias.cc:4423
0x2bdfaa8 find_func_aliases_for_call
../../gcc/gcc/tree-ssa-structalias.cc:5097
0x2be0514 find_func_aliases
../../gcc/gcc/tree-ssa-structalias.cc:5200
0x2bed27f compute_points_to_sets
../../gcc/gcc/tree-ssa-structalias.cc:7672
0x2befcba compute_may_aliases()
../../gcc/gcc/tree-ssa-structalias.cc:8126
0x23e210f execute_function_todo
../../gcc/gcc/passes.cc:2077
0x23e0250 do_per_function
../../gcc/gcc/passes.cc:1701
0x23e27e7 execute_todo
../../gcc/gcc/passes.cc:2156
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.