From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8C7FA3857B92; Tue, 9 Jan 2024 14:29:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8C7FA3857B92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1704810593; bh=AF3xadhob3tHSdy7tgLn/FhjQ0gy6KR60rQENOhEuCM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=vq9JvMjf2nDcKtTKiHUFVjBOaFpYm1trEJWf3OWQgWfkR3m1hW88YJNC46BE47TJi cBCl0rUZcFrxUhdBJRkGyvnaikGTzC2IAMIEnpF4GhX5wzXMgbhDnXhL/ncjaEhMFz DYAIWM2qvx4wfl0+iTdS9HKYagFqd9BtIlFF1JM8= From: "tnfchris at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/113287] wrong code with __builtin_mul_overflow_p() and _BitInt() with -O3 -msse4 Date: Tue, 09 Jan 2024 14:29:52 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: tnfchris at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: tnfchris at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status assigned_to cf_reconfirmed_on everconfirmed 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=3D113287 Tamar Christina changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |ASSIGNED Assignee|unassigned at gcc dot gnu.org |tnfchris at gcc dot= gnu.org Last reconfirmed| |2024-01-09 Ever confirmed|0 |1 --- Comment #3 from Tamar Christina --- I'll take it. Thanks :) The key difference between the loop that aborts and the one that doesn't is this: The one that doesn't abort generates: mask_patt_21.17_45 =3D vect__5.16_43 !=3D vect_cst__44; if (mask_patt_21.17_45 !=3D { 0, 0, 0, 0 }) goto ; [5.50%] and the one that does genertaes: mask_patt_72.30_100 =3D vect_cst__101 !=3D vect__48.29_102; if (mask_patt_72.30_100 =3D=3D { -1, -1, -1, -1 }) goto ; [20.00%] This happens when the CFG in the loop is flipped, so the vectorizer is inst= ead asking for the target to check that all values are true instead of any. Looking at ix86_expand_branch only one part of the branch does a XOR to acc= ount for the difference. So I'll first start looking whether the generated assembly is as expected.=