From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EA9C33858410; Thu, 21 Sep 2023 05:18:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EA9C33858410 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1695273509; bh=w37XTgMxlec3oma4J+4Gaq40hFdpYoQbQjURcAaAvCs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=C7zf/Y6ktU6uarNieiKNY25y+5/Vg8gzsKQ0Sq2vZML9nsl4zd8l5XAn0IepzLV2O TVTNGNKtECrUF73KJNeIQMeOyTRITTdWS4zpPluWvETkGDRMLDh1+av8AQUlNJjgHd S2wWq8vS5kHTvheaAYl2uwGoIPU1zt195bf7BbSU= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/111355] [14 Regression] ICE on valid code at -O1 and above: in lower_bound, at value-range.h:1078 Date: Thu, 21 Sep 2023 05:18:29 +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: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: DUPLICATE X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.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=3D111355 --- Comment #3 from CVS Commits --- The master branch has been updated by Jiu Fu Guo : https://gcc.gnu.org/g:4d80863d7f93c0a839d1fe5dc59be83153e89110 commit r14-4192-g4d80863d7f93c0a839d1fe5dc59be83153e89110 Author: Jiufu Guo Date: Wed Sep 20 11:11:58 2023 +0800 check undefine_p for one more vr The root cause of PR111355 and PR111482 is missing to check if vr0 is undefined_p before call vr0.lower_bound. In the pattern "(X + C) / N", (if (INTEGRAL_TYPE_P (type) && get_range_query (cfun)->range_of_expr (vr0, @0)) (if (...) (plus (op @0 @2) { wide_int_to_tree (type, plus_op1 (c)); }) (if (TYPE_UNSIGNED (type) && c.sign_mask () < 0 ... && wi::geu_p (vr0.lower_bound (), -c)) In "(if (...)", there is code to prevent vr0's undefined_p, But in the "else" part, vr0's undefined_p is not checked before "wi::geu_p (vr0.lower_bound (), -c)". PR tree-optimization/111355 gcc/ChangeLog: * match.pd ((X + C) / N): Update pattern. gcc/testsuite/ChangeLog: * gcc.dg/pr111355.c: New test.=