https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102797
--- Comment #2 from Dmitry G. Dyachenko <dimhen at gmail dot com> --- r12-4256 PASS r12-4444 FAIL $ cat x.ii struct b { b(int); }; void d() { int c = 1; do try { b a = 1; while (1) { c++; a = 1; } } catch (...) { } while (1); } $ g++ -fpreprocessed -O2 -std=c++98 -c x.ii during GIMPLE pass: evrp x.ii: In function 'void d()': x.ii:16:1: internal compiler error: tree check: expected class 'type', have 'exceptional' (error_mark) in useless_type_conversion_p, at gimple-expr.c:87 16 | } | ^ 0x90e691 tree_class_check_failed(tree_node const*, tree_code_class, char const*, int, char const*) /home/dimhen/src/gcc_current/gcc/tree.c:8739 0x7fcfb1 tree_class_check(tree_node*, tree_code_class, char const*, int, char const*) /home/dimhen/src/gcc_current/gcc/tree.h:3556 0x7fcfb1 useless_type_conversion_p(tree_node*, tree_node*) /home/dimhen/src/gcc_current/gcc/gimple-expr.c:87 0x169677a verify_gimple_phi /home/dimhen/src/gcc_current/gcc/tree-cfg.c:5128 0x169677a verify_gimple_in_cfg(function*, bool) /home/dimhen/src/gcc_current/gcc/tree-cfg.c:5457 0x154ad27 execute_function_todo /home/dimhen/src/gcc_current/gcc/passes.c:2042 0x154b73c execute_todo /home/dimhen/src/gcc_current/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. $ g++ -v Using built-in specs. COLLECT_GCC=/home/dimhen/arch-gcc/gcc_current/bin/g++ COLLECT_LTO_WRAPPER=/home/dimhen/arch-gcc/gcc_current/libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none Target: x86_64-pc-linux-gnu Configured with: /home/dimhen/src/gcc_current/configure --prefix=/home/dimhen/arch-gcc/gcc_current --enable-checking=yes,df,fold,rtl,extra --enable-languages=c,c++,lto --disable-multilib --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=native --enable-libstdcxx-debug Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 12.0.0 20211015 (experimental) [master r12-4444-ga01704fc45a] (GCC)