https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63555
Bug ID: 63555 Summary: ICE compiling simple test with SDB debugging info Product: gcc Version: 5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: lto Assignee: unassigned at gcc dot gnu.org Reporter: enkovich.gnu at gmail dot com I see ICE when try to compile a small test with -gcoff. Problem appears when we have structure field and static variable with the same name. Here is a reproducer: typedef struct { int *next; } list; int *next; int main(int argc, char **argv) { return 0; } >gcc -m64 -c -gcoff short.c cc1: internal compiler error: in needed_p, at cgraphunit.c:237 0x7c1a8c symtab_node::needed_p() ../../gcc-pl/gcc/cgraphunit.c:236 0x7c3933 analyze_functions ../../gcc-pl/gcc/cgraphunit.c:936 0x7c7579 symbol_table::finalize_compilation_unit() ../../gcc-pl/gcc/cgraphunit.c:2288 0x627b77 c_write_global_declarations() ../../gcc-pl/gcc/c/c-decl.c:10431 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <http://gcc.gnu.org/bugs.html> for instructions. Here is failing assert: /* Double check that no one output the function into assembly file early. */ gcc_checking_assert (!DECL_ASSEMBLER_NAME_SET_P (decl) || !TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))); During file parsing we have a call to sdbout_symbol for structure type. It causes output of its field and field's name is marked as referenced. Later variable analysis hits assert because variable's assembler name is shared with the structure field.