https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120589
Bug ID: 120589 Summary: __attribute__((dllimport)) caused ICE Product: gcc Version: 16.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: hjl.tools at gmail dot com CC: jeffreyalaw at gmail dot com Target Milestone: --- Target: mocre-elf [hjl@gnu-zen4-1 gcc]$ cat /tmp/x.c extern void __attribute__((dllimport)) f1(); void f2() { f1(); } [hjl@gnu-zen4-1 gcc]$ ./xgcc -B./ -S -O2 /tmp/x.c during RTL pass: expand /tmp/x.c: In function ‘f2’: /tmp/x.c:3:3: internal compiler error: in expand_call, at calls.cc:3745 3 | f1(); | ^~~~ 0x2175a0d internal_error(char const*, ...) /export/gnu/import/git/gitlab/x86-gcc-test/gcc/diagnostic-global-context.cc:517 0x2139183 fancy_abort(char const*, int, char const*) /export/gnu/import/git/gitlab/x86-gcc-test/gcc/diagnostic.cc:1803 0x68c13d expand_call(tree_node*, rtx_def*, int) /export/gnu/import/git/gitlab/x86-gcc-test/gcc/calls.cc:3745 0x86d5c2 expand_expr_real_1(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool) /export/gnu/import/git/gitlab/x86-gcc-test/gcc/expr.cc:12479 0x85ed37 expand_expr_real(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool) /export/gnu/import/git/gitlab/x86-gcc-test/gcc/expr.cc:9523 0x67ca98 expand_expr(tree_node*, rtx_def*, machine_mode, expand_modifier) /export/gnu/import/git/gitlab/x86-gcc-test/gcc/expr.h:323 0x6a9f99 expand_call_stmt /export/gnu/import/git/gitlab/x86-gcc-test/gcc/cfgexpand.cc:3151 0x6adbac expand_gimple_stmt_1 /export/gnu/import/git/gitlab/x86-gcc-test/gcc/cfgexpand.cc:4223 0x6ae1e2 expand_gimple_stmt /export/gnu/import/git/gitlab/x86-gcc-test/gcc/cfgexpand.cc:4370 0x6ae2eb expand_gimple_tailcall /export/gnu/import/git/gitlab/x86-gcc-test/gcc/cfgexpand.cc:4416 0x6b68bb expand_gimple_basic_block /export/gnu/import/git/gitlab/x86-gcc-test/gcc/cfgexpand.cc:6407 0x6b8e1f execute /export/gnu/import/git/gitlab/x86-gcc-test/gcc/cfgexpand.cc:7181 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. [hjl@gnu-zen4-1 gcc]$