From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A56743858C30; Fri, 3 Feb 2023 15:11:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A56743858C30 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675437080; bh=ghLxq/tJiK1y0oYe/B99RXJPj3hOaTC3AlI1ZbzYFF4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=QayiiJ7JNE+qgF5t84WLCk26ZBX6BvMPUTuBt1HXrVyIThSbIef1qLemgXSggNhLZ n7M8trbtyaFygtwyixEkZWYtixQ5VEGHJPcw3/8iOZU1/jRA1Apt9qJ2YUuy/JRH3Z DFX/9p80DOZuKvgEoCn535N2Aj45HcTrfwCQiWG4= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/108647] [13 Regression] ICE in upper_bound, at value-range.h:950 with -O3 since r13-2974-g67166c9ec35d58ef Date: Fri, 03 Feb 2023 15:11:20 +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: 13.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 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=3D108647 --- Comment #7 from Jakub Jelinek --- So --- gcc/range-op.cc.jj 2023-02-03 10:51:40.699003658 +0100 +++ gcc/range-op.cc 2023-02-03 16:04:39.264159294 +0100 @@ -642,7 +642,8 @@ operator_equal::op1_range (irange &r, tr case BRS_FALSE: // If the result is false, the only time we know anything is // if OP2 is a constant. - if (wi::eq_p (op2.lower_bound(), op2.upper_bound())) + if (!op2.undefined_p () + && wi::eq_p (op2.lower_bound(), op2.upper_bound())) { r =3D op2; r.invert (); @@ -755,7 +756,8 @@ operator_not_equal::op1_range (irange &r case BRS_TRUE: // If the result is true, the only time we know anything is if // OP2 is a constant. - if (wi::eq_p (op2.lower_bound(), op2.upper_bound())) + if (!op2.undefined_p () + && wi::eq_p (op2.lower_bound(), op2.upper_bound())) { r =3D op2; r.invert (); @@ -920,6 +922,9 @@ operator_lt::op1_range (irange &r, tree const irange &op2, relation_trio) const { + if (op2.undefined_p ()) + return false; + switch (get_bool_state (r, lhs, type)) { case BRS_TRUE: @@ -942,6 +947,9 @@ operator_lt::op2_range (irange &r, tree const irange &op1, relation_trio) const { + if (op1.undefined_p ()) + return false; + switch (get_bool_state (r, lhs, type)) { case BRS_TRUE: @@ -1031,6 +1039,9 @@ operator_le::op1_range (irange &r, tree const irange &op2, relation_trio) const { + if (op2.undefined_p ()) + return false; + switch (get_bool_state (r, lhs, type)) { case BRS_TRUE: @@ -1053,6 +1064,9 @@ operator_le::op2_range (irange &r, tree const irange &op1, relation_trio) const { + if (op1.undefined_p ()) + return false; + switch (get_bool_state (r, lhs, type)) { case BRS_TRUE: @@ -1141,6 +1155,9 @@ operator_gt::op1_range (irange &r, tree const irange &lhs, const irange &op2, relation_trio) const { + if (op2.undefined_p ()) + return false; + switch (get_bool_state (r, lhs, type)) { case BRS_TRUE: @@ -1163,6 +1180,9 @@ operator_gt::op2_range (irange &r, tree const irange &op1, relation_trio) const { + if (op1.undefined_p ()) + return false; + switch (get_bool_state (r, lhs, type)) { case BRS_TRUE: @@ -1252,6 +1272,9 @@ operator_ge::op1_range (irange &r, tree const irange &op2, relation_trio) const { + if (op2.undefined_p ()) + return false; + switch (get_bool_state (r, lhs, type)) { case BRS_TRUE: @@ -1274,6 +1297,9 @@ operator_ge::op2_range (irange &r, tree const irange &op1, relation_trio) const { + if (op1.undefined_p ()) + return false; + switch (get_bool_state (r, lhs, type)) { case BRS_TRUE: then plus testcase?=