From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 52DC63858282; Tue, 19 Mar 2024 14:25:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 52DC63858282 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1710858312; bh=cG2ocdk2bhHRKmQKFIfZspYCJj+QvUrDJ5HbjeOgYf4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=mJZ6VWOBnuO9NbC6DTPA5piTEkvnWiNybD3hVX+O40e+OVrbPBOa3VLz6a7cdRxXk RbVXrsszlaAtIEO2iI4jHLPA8Oag65v83Yhc9vikEn+GnhuGYfXH35/13Br31/T77S i8RAq36cZHbQdC9u5+BgOvgtjOKXOus5e1JPrvbI= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/113396] [13/14 Regression] csmith: differences from -O2 to -O3 since r13-1268-g8c99e307b20c50 Date: Tue, 19 Mar 2024 14:25:11 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.3 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=3D113396 --- Comment #31 from Richard Biener --- diff --git a/gcc/tree-dfa.cc b/gcc/tree-dfa.cc index cbd3774b21f..1dbd9bd7a00 100644 --- a/gcc/tree-dfa.cc +++ b/gcc/tree-dfa.cc @@ -549,7 +549,8 @@ get_ref_base_and_extent (tree exp, poly_int64 *poffset, /* Try to constrain maxsize with range information. */ offset_int omax =3D offset_int::from (max, TYPE_SIGN (TREE_TYPE (inde= x))); - if (known_lt (lbound, omax)) + if (wi::get_precision (max) < ADDR_MAX_PRECISION + && known_lt (lbound, omax)) { poly_offset_int rmaxsize; rmaxsize =3D (omax - lbound + 1) @@ -567,7 +568,8 @@ get_ref_base_and_extent (tree exp, poly_int64 *poffset, /* Try to adjust bit_offset with range information. */ offset_int omin =3D offset_int::from (min, TYPE_SIGN (TREE_TYPE (inde= x))); - if (known_le (lbound, omin)) + if (wi::get_precision (min) < ADDR_MAX_PRECISION + && known_le (lbound, omin)) { poly_offset_int woffset =3D wi::sext (omin - lbound, fixes the testcase but I'm not 100% sure the condition is correct. We possibly need to cover for the << LOG2_BITS_PER_UNIT done, so maybe using ADDR_MAX_BITSIZE is better. I'm going to test a variant with using <=3D ADDR_MAX_BITSIZE.=