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

--- Comment #1 from Jiangchang <jiangchangwu at smail dot nju.edu.cn> ---
Compiler Explorer: https://gcc.godbolt.org/z/WdoEqM8sc

*******************************************************************************
gcc version:
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/software/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/16.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --disable-multilib --disable-bootstrap
--enable-languages=c,c++ --prefix=/home/software/gcc-trunk --enable-coverage
--disable-werror --enable-checking=yes
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 16.0.0 20250613 (experimental) (GCC)

*******************************************************************************
Program:
$ cat mutant.c
int a = 1;
extern int a __attribute__((weakref("")));

*******************************************************************************
Command Lines:
$ gcc mutant.c
mutant.c:1:5: error: 'weakref' symbol 'a' must have static linkage
    1 | int a = 1;
      |     ^
mutant.c:1:5: warning: 'weakref' attribute ignored because variable is
initialized [-Wattributes]
cc1: internal compiler error: in get, at cgraph.h:2829
0x5554b38 internal_error(char const*, ...)
        ../../gcc/gcc/diagnostic-global-context.cc:517
0x54d2d0a fancy_abort(char const*, int, char const*)
        ../../gcc/gcc/diagnostic.cc:1803
0x1589f3c varpool_node::get(tree_node const*)
        ../../gcc/gcc/cgraph.h:2829
0x2a8dbac varpool_node::analyze()
        ../../gcc/gcc/varpool.cc:535
0x142ec20 analyze_functions
        ../../gcc/gcc/cgraphunit.cc:1319
0x1434c51 symbol_table::finalize_compilation_unit()
        ../../gcc/gcc/cgraphunit.cc:2574
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.
  • [Bug c/120911] New: ICE ... jiangchangwu at smail dot nju.edu.cn via Gcc-bugs
    • [Bug c/120911] ICE ... jiangchangwu at smail dot nju.edu.cn via Gcc-bugs

Reply via email to