From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1B7AC387606A; Thu, 27 Jun 2024 06:30:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1B7AC387606A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1719469835; bh=Aoe7KUO4skJ925KvYNYqqwONEugeKTgWOpIOZN0px+0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=WofBIe05j/vbdnitO++ie5YH3n5zW+Z4TFOEgxBoudE6c+WG6P3EHRdvh4ppTOKT3 kiDgYOuLbhuAvANTjB5UmMJBTqWXqRpUDE10qL0YM0ZBmUp8khGM+xwl7IK43cjnvb 1wfzSdi6nKNf7Jt/87J//we1uC89sYCE9NMdSJow= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/115669] [15 Regression] rv64gcv/aarch64+sve -fwrapv miscompile since r15-1006-gd93353e6423 Date: Thu, 27 Jun 2024 06:30:34 +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: 15.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: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 15.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=3D115669 --- Comment #4 from Richard Biener --- I can reproduce on aarch64 with -O2 -march=3Darmv8.3-a+sve -fno-vect-cost-m= odel -fwrapv. The reduction is [local count: 955630224]: # b_lsm.9_11 =3D PHI <_9(7), pretmp_42(6)> _4 =3D *_3; _5 =3D (signed int) _4; b.2_7 =3D (signed int) b_lsm.9_11; _15 =3D b.2_7 + -1; _8 =3D _15 - _5; _9 =3D (unsigned int) _8; with -fwrapv and # b_lsm.9_11 =3D PHI <_7(7), pretmp_40(6)> _4 =3D *_3; _5 =3D (unsigned int) _4; _15 =3D b_lsm.9_11 + 4294967295; _7 =3D _15 - _5; without. So it seems the support for singed/unsigned converted reductions is somehow broken. At least for VLA vectors. The epilog does # vect__9.22_59 =3D PHI _60 =3D (vector([4,4]) signed int) vect__9.22_59; _61 =3D .REDUC_PLUS (_60); I don't see where it goes wrong yet.=