From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9D4043983000; Tue, 10 Nov 2020 08:29:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9D4043983000 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/97767] [11 Regression] ICE in extract_range_basic, at vr-values.c:1445 since r11-4532-g054d7b9f6f6816a8 Date: Tue, 10 Nov 2020 08:29:08 +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: 11.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit 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: 11.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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2020 08:29:08 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97767 --- Comment #2 from CVS Commits --- The master branch has been updated by Aldy Hernandez : https://gcc.gnu.org/g:3d3470e239e8040f642a8852721b4962b4ed36f2 commit r11-4864-g3d3470e239e8040f642a8852721b4962b4ed36f2 Author: Aldy Hernandez Date: Mon Nov 9 20:35:25 2020 +0100 Normalize VARYING for -fstrict-enums. The problem here is that the representation for VARYING in -fstrict-enums is different between value_range and irange. The helper function irange::normalize_min_max() will normalize to VARYING only if setting the range to the entire domain of the underlying type. That is, [0, 0xff..ff], not the domain as defined by -fstrict-enums. This causes problems because the multi-range version of varying_p() will return true if the range is the domain as defined by -fstrict-enums. Thus, normalize_min_max and varying_p have different concepts of varying for multi-ranges. (BTW, legacy ranges are different because they never look at the extremes of a range to determine varying-ness. They only look at the kind field.) One approach is to change all the code to limit ranges to the domain in the -fstrict-enums world, but this won't work because there are various instances of gimple where the values assigned or compared are beyond the limits of TYPE_{MIN,MAX}_VALUE. One example is the addition of 0xffffffff to represent subtraction. This patch fixes multi-range varying_p() and set_varying() to agree with the normalization code, using the extremes of the underlying type, to represent varying. gcc/ChangeLog: PR tree-optimization/97767 * value-range.cc (dump_bound_with_infinite_markers): Use wi::min_value and wi::max_value. (range_tests_strict_enum): New. (range_tests): Call range_tests_strict_enum. * value-range.h (irange::varying_p): Use wi::min_value and wi::max_value. (irange::set_varying): Same. (irange::normalize_min_max): Remove comment. gcc/testsuite/ChangeLog: * g++.dg/opt/pr97767.C: New test.=