From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 104303858C5E; Thu, 21 Mar 2024 03:25:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 104303858C5E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1710991543; bh=7GlpjoaPGmPuIAHywHMVkldVRDIyGh/fwKpqqg0Yi2k=; h=From:To:Subject:Date:In-Reply-To:References:From; b=t+gEMNRWdEmT9Y0HC4FH7f0GkcgLXd0wfdgFZrJlaMSbAyQ+/kNfeBi6tTMeDG/Bo 81U7dkXsJP3d5TBsOw6YS6npR/dD0trsz0UzO1fcC6izr4a0M3zsPquLga+MXllgIo gcrQqXTQsNCCe2Iis66OwEH/Dl6JyoVVy5wX2USM= From: "liuhongt at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/114396] [13/14 Regression] Vector: Runtime mismatch at -O2 with -fwrapv since r13-7988-g82919cf4cb2321 Date: Thu, 21 Mar 2024 03:25:41 +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: liuhongt at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: liuhongt 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=3D114396 --- Comment #17 from Hongtao Liu --- > >=20 > > The to_mpz args look like they could be mixing signs as well: > >=20 I tries below, looks like mixing signs works well. debug show step_expr is -5 and signed. short a =3D 0xF; short b[16]; unsigned short ua =3D 0xF; unsigned short ub[16]; int main() { for (int e =3D 0; e < 9; e +=3D 1) b[e] =3D a *=3D 0x5; __builtin_printf("decimal: %d\n", a); __builtin_printf("hex: %X\n", a); for (int e =3D 0; e < 9; e +=3D 1) b[e] =3D a *=3D -5; __builtin_printf("decimal: %d\n", a); __builtin_printf("hex: %X\n", a); for (int e =3D 0; e < 9; e +=3D 1) ub[e] =3D ua *=3D 0x5; __builtin_printf("decimal: %d\n", ua); __builtin_printf("hex: %X\n", ua); for (int e =3D 0; e < 9; e +=3D 1) ub[e] =3D ua *=3D -5; __builtin_printf("decimal: %d\n", ua); __builtin_printf("hex: %X\n", ua); }=