From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 25F463858CD1; Tue, 19 Mar 2024 20:48:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 25F463858CD1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1710881321; bh=KdhKOvQvhNuQRGE9B74ISO2Z6UXqSLmJ0nhP3Fxoijg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=r3QY7UHcnEVczZQyZJoExvlKGoCG6yC3EgSLX2tJZ8Q9p+S7ClXYXBP+AEb36FSUy c3IC3RDM6Cq2DUvE7INKK8vig+aMgQ5Ph08SJ3D9y9QhlTh4hWcFCYbG6wRYMuE0jY dvjDWVIyfJ+2bbal5gf2/EO2APvi+aj4APni5nnQ= From: "rdapp at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/114396] [14 Regression] Vector: Runtime mismatch at -O2 with -fwrapv Date: Tue, 19 Mar 2024 20:48: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: needs-bisection, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rdapp 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: 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=3D114396 --- Comment #7 from Robin Dapp --- diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc index 4375ebdcb49..f8f7ba0ccc1 100644 --- a/gcc/tree-vect-loop.cc +++ b/gcc/tree-vect-loop.cc @@ -9454,7 +9454,7 @@ vect_peel_nonlinear_iv_init (gimple_seq* stmts, tree init_expr, wi::to_mpz (skipn, exp, UNSIGNED); mpz_ui_pow_ui (mod, 2, TYPE_PRECISION (type)); mpz_powm (res, base, exp, mod); - begin =3D wi::from_mpz (type, res, TYPE_SIGN (type)); + begin =3D wi::from_mpz (type, res, TYPE_SIGN (utype)); tree mult_expr =3D wide_int_to_tree (utype, begin); init_expr =3D gimple_build (stmts, MULT_EXPR, utype, init_expr, mult_expr); This helps for the test case.=