https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113624
Bug ID: 113624 Summary: FAIL: g++.dg/ext/dllimport4.C, ICE on windows targets Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: nightstrike at gmail dot com Target Milestone: --- Created attachment 57235 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57235&action=edit output of -freport-bug A test from the testsuite is failing for extra errors, but it also ICE's, so this PR is to document the ICE. This is the reduced dllimport4.C: void faz() { __attribute__((dllimport)) int faa = 1; faa++; } $ x86_64-w64-mingw32-g++ -c dllimport4.C dllimport4.C: In function 'void faz()': dllimport4.C:2:34: error: variable 'faa' definition is marked dllimport 2 | __attribute__((dllimport)) int faa = 1; | ^~~ dllimport4.C:4:1: internal compiler error: Segmentation fault 4 | } | ^ 0x138a72f crash_signal ../../gcc/toplev.cc:317 0xb1287b cp_genericize_r ../../gcc/cp/cp-gimplify.cc:1620 0x16bddbc walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*, tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*)) ../../gcc/tree.cc:11420 0xdae64f c_genericize_control_stmt(tree_node**, int*, void*, tree_node* (*)(tree_node**, int*, void*), tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*)) ../../gcc/c-family/c-gimplify.cc:557 0xb12aab cp_genericize_r ../../gcc/cp/cp-gimplify.cc:2225 0x16bddbc walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*, tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*)) ../../gcc/tree.cc:11420 0xb13e9f cp_genericize_r ../../gcc/cp/cp-gimplify.cc:1836 0x16bddbc walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*, tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*)) ../../gcc/tree.cc:11420 0xb12091 cp_genericize_tree ../../gcc/cp/cp-gimplify.cc:2258 0xb12409 cp_genericize(tree_node*) ../../gcc/cp/cp-gimplify.cc:2400 0xb62716 finish_function(bool) ../../gcc/cp/decl.cc:18800 0xc695b7 cp_parser_function_definition_after_declarator ../../gcc/cp/parser.cc:32699 0xc6a74e cp_parser_function_definition_from_specifiers_and_declarator ../../gcc/cp/parser.cc:32613 0xc6a74e cp_parser_init_declarator ../../gcc/cp/parser.cc:23356 0xc3dcd4 cp_parser_simple_declaration ../../gcc/cp/parser.cc:15890 0xc770ba cp_parser_declaration ../../gcc/cp/parser.cc:15563 0xc77f9a cp_parser_toplevel_declaration ../../gcc/cp/parser.cc:15584 0xc77f9a cp_parser_translation_unit ../../gcc/cp/parser.cc:5276 0xc77f9a c_parse_file() ../../gcc/cp/parser.cc:51174 0xdc6531 c_common_parse_file() ../../gcc/c-family/c-opts.cc:1301 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. $ x86_64-w64-mingw32-g++ -v Using built-in specs. COLLECT_GCC=x86_64-w64-mingw32-g++ COLLECT_LTO_WRAPPER=/tmp/rt/mingw14/bin/../libexec/gcc/x86_64-w64-mingw32/14.0.1/lto-wrapper Target: x86_64-w64-mingw32 Configured with: ../configure --disable-multilib --disable-nls --target=x86_64-w64-mingw32 --prefix=/tmp/rt/mingw14 --with-sysroot=/tmp/rt/mingw14 --enable-languages=c,ada,c++,d,fortran,lto,m2,objc,obj-c++,rust Thread model: win32 Supported LTO compression algorithms: zlib zstd gcc version 14.0.1 20240126 (experimental) (GCC)