https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101131
Bug ID: 101131 Summary: ICE with -O2: in noninterposable_alias, at symtab.c:2011 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.M5bbDhYIJL-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 20210618 (experimental) [master revision :9f6824b35:688359a27d835bbdab554fdf5eb207f1bd678371] (GCC) $ cat mutant.c extern_declared_variable; global_defined_function() { static_function(); } __attribute__((ifunc("resolver"))) static_function() { if (extern_declared_variable) return global_defined_function(); } $ gcc-trunk -O2 mutant.c mutant.c:1:1: warning: data definition has no type or storage class 1 | extern_declared_variable; | ^~~~~~~~~~~~~~~~~~~~~~~~ mutant.c:1:1: warning: type defaults to ‘int’ in declaration of ‘extern_declared_variable’ [-Wimplicit-int] mutant.c:2:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 2 | global_defined_function() { static_function(); } | ^~~~~~~~~~~~~~~~~~~~~~~ mutant.c: In function ‘global_defined_function’: mutant.c:2:29: warning: implicit declaration of function ‘static_function’ [-Wimplicit-function-declaration] 2 | global_defined_function() { static_function(); } | ^~~~~~~~~~~~~~~ mutant.c: At top level: mutant.c:3:36: warning: return type defaults to ‘int’ [-Wimplicit-int] 3 | __attribute__((ifunc("resolver"))) static_function() { | ^~~~~~~~~~~~~~~ mutant.c:3:36: warning: ‘alias’ attribute ignored because function is defined [-Wattributes] during IPA pass: whole-program mutant.c:6:1: internal compiler error: in noninterposable_alias, at symtab.c:2011 6 | } | ^ 0x695a35 symtab_node::noninterposable_alias() /tmp/tmp.M5bbDhYIJL-gcc-builder/gcc/gcc/symtab.c:2011 0x19fd08f function_and_variable_visibility /tmp/tmp.M5bbDhYIJL-gcc-builder/gcc/gcc/ipa-visibility.c:773 0x19fd6ca whole_program_function_and_variable_visibility /tmp/tmp.M5bbDhYIJL-gcc-builder/gcc/gcc/ipa-visibility.c:921 0x19fd6ca execute /tmp/tmp.M5bbDhYIJL-gcc-builder/gcc/gcc/ipa-visibility.c:969 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.