Bug 100888 - ICE: symtab_node::verify failed, symtab_node::verify()
Summary: ICE: symtab_node::verify failed, symtab_node::verify()
Status: RESOLVED DUPLICATE of bug 61192
Alias: None
Product: gcc
Classification: Unclassified
Component: ipa (show other bugs)
Version: 12.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-invalid-code
Depends on:
Blocks:
 
Reported: 2021-06-02 21:32 UTC by Chengnian Sun
Modified: 2021-12-24 10:34 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2021-09-22 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chengnian Sun 2021-06-02 21:32:04 UTC
$ 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.2G3KkJkZyC-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 20210602 (experimental) [master revision :5b6bc0f6e:b75978d14fc35981ffd8bf060ee52300db4dae50] (GCC)

$ cat mutant.c
register __sys_res asm("r10");
r10() {}

$ gcc-trunk  mutant.c
mutant.c:1:10: warning: type defaults to ‘int’ in declaration of ‘__sys_res’ [-Wimplicit-int]
    1 | register __sys_res asm("r10");
      |          ^~~~~~~~~
mutant.c:1:10: warning: call-clobbered register used for global register variable
mutant.c:2:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
    2 | r10() {}
      | ^~~
mutant.c:2:1: error: assembler name hash list corrupted
*r10/0 (__sys_res) @0x7f5bf87f5000
  Type: variable definition analyzed
  Visibility: force_output no_reorder public
  References:
  Referring:
  Availability: not-ready
  Varpool flags:
mutant.c:2:1: internal compiler error: symtab_node::verify failed
0xa717c9 symtab_node::verify()
	/tmp/tmp.2G3KkJkZyC-gcc-builder/gcc/gcc/symtab.c:1361
0xa717c9 symtab_node::verify()
	/tmp/tmp.2G3KkJkZyC-gcc-builder/gcc/gcc/symtab.c:1349
0xa72a27 symtab_node::verify_symtab_nodes()
	/tmp/tmp.2G3KkJkZyC-gcc-builder/gcc/gcc/symtab.c:1384
0xa88b04 symtab_node::checking_verify_symtab_nodes()
	/tmp/tmp.2G3KkJkZyC-gcc-builder/gcc/gcc/cgraph.h:678
0xa88b04 symbol_table::compile()
	/tmp/tmp.2G3KkJkZyC-gcc-builder/gcc/gcc/cgraphunit.c:2272
0xa8b7db symbol_table::compile()
	/tmp/tmp.2G3KkJkZyC-gcc-builder/gcc/gcc/cgraphunit.c:2269
0xa8b7db symbol_table::finalize_compilation_unit()
	/tmp/tmp.2G3KkJkZyC-gcc-builder/gcc/gcc/cgraphunit.c:2537
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.
Comment 1 Martin Liška 2021-06-03 09:33:58 UTC
Started with my r9-6392-g606711a1671cc637.
Comment 2 Martin Liška 2021-08-13 09:58:18 UTC
It's an invalid code as a global register variable shares the same name with a function.
Comment 3 Andrew Pinski 2021-12-24 10:34:18 UTC
(In reply to Martin Liška from comment #1)
> Started with my r9-6392-g606711a1671cc637.

It didn't exactly start with patch as it was failing with LTO before that.

Dup of bug 61192.

*** This bug has been marked as a duplicate of bug 61192 ***