https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105026
Bug ID: 105026 Summary: ICE: SIGSEGV in tree_class_check with __int128 and _Fract comparison Product: gcc Version: 12.0 Status: UNCONFIRMED Keywords: error-recovery Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: zsojka at seznam dot cz Target Milestone: --- Host: x86_64-pc-linux-gnu Target: mips64el-unknown-linux-gnuabi64 Created attachment 52667 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52667&action=edit reduced testcase Compiler output: $ mips64el-unknown-linux-gnuabi64-gcc testcase.c -wrapper valgrind,-q,--track-origins=yes testcase.c:1:1: sorry, unimplemented: GCC cannot support operators with integer types and fixed-point types that have too many integral and fractional bits together 1 | int i = (__int128) 0 == (_Fract) 0; | ^~~ ==15373== Invalid read of size 2 ==15373== at 0x969319: tree_class_check (tree.h:3573) ==15373== by 0x969319: shorten_compare(unsigned int, tree_node**, tree_node**, tree_node**, tree_code*) (c-common.cc:3197) ==15373== by 0x8DE4F9: build_binary_op(unsigned int, tree_code, tree_node*, tree_node*, bool) (c-typeck.cc:12746) ==15373== by 0x8E2BB1: parser_build_binary_op(unsigned int, tree_code, c_expr, c_expr) (c-typeck.cc:3821) ==15373== by 0x9093C9: c_parser_binary_expression(c_parser*, c_expr*, tree_node*) (c-parser.cc:8036) ==15373== by 0x90A50B: c_parser_conditional_expression(c_parser*, c_expr*, tree_node*) (c-parser.cc:7606) ==15373== by 0x90AD30: c_parser_expr_no_commas(c_parser*, c_expr*, tree_node*) (c-parser.cc:7521) ==15373== by 0x90DF0C: c_parser_initializer (c-parser.cc:5218) ==15373== by 0x90DF0C: c_parser_initializer(c_parser*) (c-parser.cc:5210) ==15373== by 0x92354E: c_parser_declaration_or_fndef(c_parser*, bool, bool, bool, bool, bool, tree_node**, vec<c_token, va_heap, vl_ptr>*, bool, tree_node*, oacc_routine_data*, bool*) (c-parser.cc:2281) ==15373== by 0x92C7E3: c_parser_external_declaration(c_parser*) (c-parser.cc:1779) ==15373== by 0x92D22B: c_parser_translation_unit (c-parser.cc:1652) ==15373== by 0x92D22B: c_parse_file() (c-parser.cc:23357) ==15373== by 0x98F2DD: c_common_parse_file() (c-opts.cc:1240) ==15373== by 0xF383AD: compile_file() (toplev.cc:452) ==15373== Address 0x0 is not stack'd, malloc'd or (recently) free'd ==15373== testcase.c:1:1: internal compiler error: Segmentation fault 0xf382cf crash_signal /repo/gcc-trunk/gcc/toplev.cc:322 0x969319 tree_class_check(tree_node*, tree_code_class, char const*, int, char const*) /repo/gcc-trunk/gcc/tree.h:3573 0x969319 shorten_compare(unsigned int, tree_node**, tree_node**, tree_node**, tree_code*) /repo/gcc-trunk/gcc/c-family/c-common.cc:3197 0x8de4f9 build_binary_op(unsigned int, tree_code, tree_node*, tree_node*, bool) /repo/gcc-trunk/gcc/c/c-typeck.cc:12746 0x8e2bb1 parser_build_binary_op(unsigned int, tree_code, c_expr, c_expr) /repo/gcc-trunk/gcc/c/c-typeck.cc:3821 0x9093c9 c_parser_binary_expression /repo/gcc-trunk/gcc/c/c-parser.cc:8036 0x90a50b c_parser_conditional_expression /repo/gcc-trunk/gcc/c/c-parser.cc:7606 0x90ad30 c_parser_expr_no_commas /repo/gcc-trunk/gcc/c/c-parser.cc:7521 0x90df0c c_parser_initializer /repo/gcc-trunk/gcc/c/c-parser.cc:5218 0x90df0c c_parser_initializer /repo/gcc-trunk/gcc/c/c-parser.cc:5210 0x92354e c_parser_declaration_or_fndef /repo/gcc-trunk/gcc/c/c-parser.cc:2281 0x92c7e3 c_parser_external_declaration /repo/gcc-trunk/gcc/c/c-parser.cc:1779 0x92d22b c_parser_translation_unit /repo/gcc-trunk/gcc/c/c-parser.cc:1652 0x92d22b c_parse_file() /repo/gcc-trunk/gcc/c/c-parser.cc:23357 0x98f2dd c_common_parse_file() /repo/gcc-trunk/gcc/c-family/c-opts.cc:1240 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. $ mips64el-unknown-linux-gnuabi64-gcc -v Using built-in specs. COLLECT_GCC=/repo/gcc-trunk/binary-latest-mips64el/bin/mips64el-unknown-linux-gnuabi64-gcc COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r12-7721-20220319135312-gb60bc913cca-checking-yes-rtl-df-extra-mips64el/bin/../libexec/gcc/mips64el-unknown-linux-gnuabi64/12.0.1/lto-wrapper Target: mips64el-unknown-linux-gnuabi64 Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++ --enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra --with-cloog --with-ppl --with-isl --with-sysroot=/usr/mips64el-unknown-linux-gnuabi64 --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --target=mips64el-unknown-linux-gnuabi64 --with-ld=/usr/bin/mips64el-unknown-linux-gnuabi64-ld --with-as=/usr/bin/mips64el-unknown-linux-gnuabi64-as --disable-multilib --with-abi=64 --disable-libstdcxx-pch --prefix=/repo/gcc-trunk//binary-trunk-r12-7721-20220319135312-gb60bc913cca-checking-yes-rtl-df-extra-mips64el Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 12.0.1 20220319 (experimental) (GCC)