From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AD3243858D28; Mon, 15 Jan 2024 14:42:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AD3243858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1705329760; bh=+c11uQ4bPGny96mexy/aXLex3o7I7x2f4yiMUbm39u0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=EVMveobjSxbco+uvNdy4DQJIEynwvJsr8I+nK+CODF22IXnAbReqJRzx1elZ7JAvs prLTC9e+EbBYHNTtGtpTpjpTbjMCK2I5BCjbGGqvt1vb5mPRvKdBg0Cmtd6AHlHQkN mCHMJ3syMpSwWwv99gf6F9I9ZREqyqXipyP94zy4= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/113372] wrong code with _BitInt() arithmetics at -O1 Date: Mon, 15 Jan 2024 14:42:40 +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: 14.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW 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=3D113372 --- Comment #15 from Richard Biener --- (In reply to Jakub Jelinek from comment #14) > Created attachment 57085 [details] > gcc14-pr113372.patch >=20 > The non-propagation workaround which seems to fix^H^H^Hworkaround all tho= se > 4 issues (PR90348 testcase actually doesn't FAIL anymore, but I've verifi= ed > the patch results in in and buf no longer being shared) can look like thi= s. + || (INTEGRAL_TYPE_P (TREE_TYPE (use)) + && TYPE_PRECISION (TREE_TYPE (use)) =3D=3D POINTER_SIZE))) ptrofftype_p (TREE_TYPE (use)) + { + gimple *g =3D SSA_NAME_DEF_STMT (use); + if (is_gimple_assign (g)) + for (unsigned i =3D 1; i < gimple_num_ops (g); ++i) + { + tree op =3D gimple_op (g, i); + if (op && TREE_CODE (op) =3D=3D ADDR_EXPR) I think it should be enough to look at gimple_assing_rhs1, that works for single non-invariant &a[i], for conversions and for offsetting of an invariant address (pointer-plus). I'd say OK with those changes.=