From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2952A3858C52; Thu, 2 Feb 2023 21:21:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2952A3858C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675372870; bh=9mn/jb0Nf/ocxLYSoBgGMZh1r+FBC5KNjio3L2m83PE=; h=From:To:Subject:Date:From; b=a3UGKguRhQQ4gg6ei/Gy+Py8kW32ogEIjpvL5Torjwu27/70/Y1IIr0fpZaRMRZJP BbcxdXDYkoJsZtLhSPFwICKxcnb1WkRUkmH3B4Btr7SbFOPpBGy3pYwRt1OrkKNWv+ 81L67IK91CsqdUceLXTsE1ejH198fKGM3tua3ecw= From: "vsevolod.livinskiy at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/108647] New: [13 Regression] ICE in upper_bound, at value-range.h:950 with -O3 Date: Thu, 02 Feb 2023 21:21:09 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vsevolod.livinskiy at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108647 Bug ID: 108647 Summary: [13 Regression] ICE in upper_bound, at value-range.h:950 with -O3 Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: vsevolod.livinskiy at gmail dot com Target Milestone: --- Link to the Compiler Explorer: https://godbolt.org/z/PMGTPGPab Reproducer: bool a; int b, c; inline const bool &d(bool &e, const bool &f) { return f < e ? f : e; } void g(char e, bool f[], bool h[], bool p4[]) { for (;;) if (p4) for (char j =3D 0; j < 6; j +=3D (f[0] & c ? p4[0] : int(0 >=3D e)) ? 0 : d(p4[0], p4[0] > h[0]) + 1) { a =3D 0; b =3D 0; } } Error: >$ g++ -O3 -c func.cpp during GIMPLE pass: thread func.cpp: In function 'void g(char, bool*, bool*, bool*)': func.cpp:4:6: internal compiler error: in upper_bound, at value-range.h:950 4 | void g(char e, bool f[], bool h[], bool p4[]) { | ^ 0x995922 irange::upper_bound() const /testing/gcc/gcc_src_master/gcc/value-range.h:950 0x9961f0 irange::upper_bound() const /testing/gcc/gcc_src_master/gcc/tree.h:3653 0x9961f0 operator_lt::op2_range(irange&, tree_node*, irange const&, irange const&, relation_trio) const /testing/gcc/gcc_src_master/gcc/range-op.cc:952 0x20cc69f gori_compute::refine_using_relation(tree_node*, vrange&, tree_nod= e*, vrange&, fur_source&, relation_kind_t) /testing/gcc/gcc_src_master/gcc/gimple-range-gori.cc:1034 0x20ce404 gori_compute::compute_operand1_range(vrange&, gimple_range_op_handler&, vrange const&, tree_node*, fur_source&, value_relation*) /testing/gcc/gcc_src_master/gcc/gimple-range-gori.cc:1092 0x20cd0e5 gori_compute::compute_operand_range(vrange&, gimple*, vrange cons= t&, tree_node*, fur_source&, value_relation*) /testing/gcc/gcc_src_master/gcc/gimple-range-gori.cc:700 0x20d0ad8 gori_compute::outgoing_edge_range_p(vrange&, edge_def*, tree_node= *, range_query&) /testing/gcc/gcc_src_master/gcc/gimple-range-gori.cc:1358 0x141362d path_range_query::compute_ranges_in_block(basic_block_def*) /testing/gcc/gcc_src_master/gcc/gimple-range-path.cc:454 0x1413d3a path_range_query::compute_ranges(bitmap_head const*) /testing/gcc/gcc_src_master/gcc/gimple-range-path.cc:622 0x149cd3a back_threader::find_taken_edge_cond(vec const&, gcond*) /testing/gcc/gcc_src_master/gcc/tree-ssa-threadbackward.cc:324 0x149cf33 back_threader::maybe_register_path(back_threader_profitability&) /testing/gcc/gcc_src_master/gcc/tree-ssa-threadbackward.cc:248 0x149d2d0 back_threader::find_paths_to_names(basic_block_def*, bitmap_head*, unsigned int, back_threader_profitability&) /testing/gcc/gcc_src_master/gcc/tree-ssa-threadbackward.cc:371 0x149d789 back_threader::find_paths_to_names(basic_block_def*, bitmap_head*, unsigned int, back_threader_profitability&) /testing/gcc/gcc_src_master/gcc/tree-ssa-threadbackward.cc:479 0x149d789 back_threader::find_paths_to_names(basic_block_def*, bitmap_head*, unsigned int, back_threader_profitability&) /testing/gcc/gcc_src_master/gcc/tree-ssa-threadbackward.cc:479 0x149d789 back_threader::find_paths_to_names(basic_block_def*, bitmap_head*, unsigned int, back_threader_profitability&) /testing/gcc/gcc_src_master/gcc/tree-ssa-threadbackward.cc:479 0x149d789 back_threader::find_paths_to_names(basic_block_def*, bitmap_head*, unsigned int, back_threader_profitability&) /testing/gcc/gcc_src_master/gcc/tree-ssa-threadbackward.cc:479 0x149e258 back_threader::maybe_thread_block(basic_block_def*) /testing/gcc/gcc_src_master/gcc/tree-ssa-threadbackward.cc:551 0x149e321 back_threader::thread_blocks() /testing/gcc/gcc_src_master/gcc/tree-ssa-threadbackward.cc:975 0x149e398 execute /testing/gcc/gcc_src_master/gcc/tree-ssa-threadbackward.cc:1077 gcc version 13.0.1 20230201 (a2c848c92c3f13c2dd9bd92d22beb44c1ff848b4)=