From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CC66F3858D32; Sun, 2 Oct 2022 11:58:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CC66F3858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664711886; bh=Lpjaf7EBSXSHarxMP0sGqNmrv11tJoKQbsV7IFcaFAQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Qn2g9/dlJ8MIr2AurEK3akVFcDmeTLLoiuFKvNf0ze55cyHv54IMjsVrxWVP6GxeV DqBZvHCdlkoWkG78DESf48II5jDN8m8yE0pp7nUVfFJCjGzbNwr7SRoWkIQ4PxYcB7 9XyDXmI9BU77F7BCyInmKJq/d/jIEQQNDDQGQEmQ= From: "zhendong.su at inf dot ethz.ch" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/107109] ICE on valid code at -O1 on x86_64-linux-gnu: in type, at value-range.h:621 Date: Sun, 02 Oct 2022 11:58:06 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: zhendong.su at inf dot ethz.ch 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: Message-ID: In-Reply-To: References: 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=3D107109 --- Comment #1 from Zhendong Su --- Another test that only reproduces at -O2 and -O3. [508] % gcctk -v Using built-in specs. COLLECT_GCC=3Dgcctk COLLECT_LTO_WRAPPER=3D/local/suz-local/software/local/gcc-trunk/libexec/gcc= /x86_64-pc-linux-gnu/13.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc-trunk/configure --disable-bootstrap --enable-checking=3Dyes --prefix=3D/local/suz-local/software/local/gcc-trunk --enable-sanitizers --enable-languages=3Dc,c++ --disable-werror --enable-mu= ltilib --with-system-zlib Thread model: posix Supported LTO compression algorithms: zlib gcc version 13.0.0 20221002 (experimental) [master r13-3015-g3290dcf1499] (= GCC)=20 [509] %=20 [509] % gcctk -O1 small.c; ./a.out [510] %=20 [510] % gcctk -O2 small.c during GIMPLE pass: dom small.c: In function =E2=80=98main=E2=80=99: small.c:2:5: internal compiler error: in type, at value-range.h:621 2 | int main() { | ^~~~ 0x85dab4 irange::type() const ../../gcc-trunk/gcc/value-range.h:621 0x85e731 irange::type() const ../../gcc-trunk/gcc/tree.h:3634 0x85e731 adjust_op1_for_overflow ../../gcc-trunk/gcc/range-op.cc:1373 0x1de43e3 operator_plus::op1_range(irange&, tree_node*, irange const&, iran= ge const&, relation_kind_t) const ../../gcc-trunk/gcc/range-op.cc:1414 0x1de43e3 operator_plus::op1_range(irange&, tree_node*, irange const&, iran= ge const&, relation_kind_t) const ../../gcc-trunk/gcc/range-op.cc:1400 0x1de43e3 operator_plus::op2_range(irange&, tree_node*, irange const&, iran= ge const&, relation_kind_t) const ../../gcc-trunk/gcc/range-op.cc:1424 0x1ce8e58 gori_compute::compute_operand2_range(vrange&, gimple_range_op_handler&, vrange const&, tree_node*, fur_source&, value_relation*) ../../gcc-trunk/gcc/gimple-range-gori.cc:1182 0x1ce7435 gori_compute::compute_operand_range(vrange&, gimple*, vrange cons= t&, tree_node*, fur_source&, value_relation*) ../../gcc-trunk/gcc/gimple-range-gori.cc:694 0x1ce85df gori_compute::compute_operand1_range(vrange&, gimple_range_op_handler&, vrange const&, tree_node*, fur_source&, value_relation*) ../../gcc-trunk/gcc/gimple-range-gori.cc:1140 0x1ce7bdd gori_compute::compute_operand_range(vrange&, gimple*, vrange cons= t&, tree_node*, fur_source&, value_relation*) ../../gcc-trunk/gcc/gimple-range-gori.cc:692 0x1ce8ed0 gori_compute::compute_operand2_range(vrange&, gimple_range_op_handler&, vrange const&, tree_node*, fur_source&, value_relation*) ../../gcc-trunk/gcc/gimple-range-gori.cc:1228 0x1ce7435 gori_compute::compute_operand_range(vrange&, gimple*, vrange cons= t&, tree_node*, fur_source&, value_relation*) ../../gcc-trunk/gcc/gimple-range-gori.cc:694 0x1ce7209 gori_compute::compute_logical_operands(vrange&, vrange&, gimple_range_op_handler&, irange const&, tree_node*, fur_source&, tree_node= *, bool) ../../gcc-trunk/gcc/gimple-range-gori.cc:913 0x1ce7aae gori_compute::compute_operand_range(vrange&, gimple*, vrange cons= t&, tree_node*, fur_source&, value_relation*) ../../gcc-trunk/gcc/gimple-range-gori.cc:674 0x1ce85df gori_compute::compute_operand1_range(vrange&, gimple_range_op_handler&, vrange const&, tree_node*, fur_source&, value_relation*) ../../gcc-trunk/gcc/gimple-range-gori.cc:1140 0x1ce7bdd gori_compute::compute_operand_range(vrange&, gimple*, vrange cons= t&, tree_node*, fur_source&, value_relation*) ../../gcc-trunk/gcc/gimple-range-gori.cc:692 0x1ceafd8 gori_compute::outgoing_edge_range_p(vrange&, edge_def*, tree_node= *, range_query&) ../../gcc-trunk/gcc/gimple-range-gori.cc:1358 0x10a218d path_range_query::compute_ranges_in_block(basic_block_def*) ../../gcc-trunk/gcc/gimple-range-path.cc:454 0x10a2882 path_range_query::compute_ranges(bitmap_head const*) ../../gcc-trunk/gcc/gimple-range-path.cc:622 0x112dd90 hybrid_jt_simplifier::simplify(gimple*, gimple*, basic_block_def*, jt_state*) ../../gcc-trunk/gcc/tree-ssa-threadedge.cc:1418 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See for instructions. [511] %=20 [511] % cat small.c int a, b =3D 1, c; int main() { if (b <=3D 0) { if (a) L: if (b && a <=3D 600000000) b =3D c; int e =3D ~(a + b); if ((b <=3D e || a > e) && a) a =3D 0; if (b < 0) goto L; if (b >=3D a) while (1) ; } return 0; }=