https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100636
Bug ID: 100636 Summary: ICE at -Os and above: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:88 Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: zhendong.su at inf dot ethz.ch Target Milestone: --- [547] % gcctk -v Using built-in specs. COLLECT_GCC=gcctk COLLECT_LTO_WRAPPER=/local/suz-local/software/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc-trunk/configure --disable-bootstrap --prefix=/local/suz-local/software/local/gcc-trunk --enable-languages=c,c++ --disable-werror --enable-multilib --with-system-zlib Thread model: posix Supported LTO compression algorithms: zlib gcc version 12.0.0 20210517 (experimental) [master revision e49ff61d419:73ee0e029f5:1dfb5d8ab52c3c76c877077d8d6dc4eaae3c6153] (GCC) [548] % [548] % gcctk -O1 -c small.c [549] % [549] % gcctk -Os -c small.c during GIMPLE pass: evrp small.c: In function ‘b’: small.c:12:1: internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at gimple-expr.c:88 12 | } | ^ 0x60e331 tree_class_check_failed(tree_node const*, tree_code_class, char const*, int, char const*) ../../gcc-trunk/gcc/tree.c:8724 0x9eae57 tree_class_check(tree_node*, tree_code_class, char const*, int, char const*) ../../gcc-trunk/gcc/tree.h:3479 0x9eae57 useless_type_conversion_p(tree_node*, tree_node*) ../../gcc-trunk/gcc/gimple-expr.c:88 0xd83552 verify_gimple_comparison ../../gcc-trunk/gcc/tree-cfg.c:3515 0xd9a0a0 verify_gimple_in_cfg(function*, bool) ../../gcc-trunk/gcc/tree-cfg.c:5443 0xc43b3e execute_function_todo ../../gcc-trunk/gcc/passes.c:2042 0xc44a22 execute_todo ../../gcc-trunk/gcc/passes.c:2096 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. [550] % [550] % cat small.c static int a; void b() { int c; while (a) { while (a) if (c) b(); if (--c) while (1) ; } }