From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1C2633858431; Fri, 5 Apr 2024 13:23:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1C2633858431 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712323405; bh=r6ab8hzJe4tVWNLy7OarBUQtQj8aLqmQuJPKpnDayDs=; h=From:To:Subject:Date:From; b=rcaz0joYWbXIngX0HEDiSTa84N/814FBpr8VSnhd+B5CdxnjOgXWsHjZvQ1fGGqiA T5FTdzfn1DkimAJrm6QlM7Sv0vBoR450ajljxLlZ0tqDBoxBv1DD9W9vd9D/1fJtWy jxxH1+dD/bzsULw6sfbcSXXJBUA3l+zQyOiYtdb4= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/114605] New: [14 Regression] wrong code with -march=z13 -O0 since r14-5831 Date: Fri, 05 Apr 2024 13:23:24 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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=3D114605 Bug ID: 114605 Summary: [14 Regression] wrong code with -march=3Dz13 -O0 since r14-5831 Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: jakub at gcc dot gnu.org Target Milestone: --- Since r14-5831-gaae723d360ca26cd9fd0b039fb0a616bd0eae363 we miscompile the following testcase on s390x-linux with -O0 -march=3Dz13: typedef struct { const float *a; int b, c; float *d; } S; __attribute__((noipa)) void bar (void) { } __attribute__((noinline, optimize (2))) static void foo (S *e) { const float *f; float *g; float h[4] =3D { 0.0, 0.0, 1.0, 1.0 }; if (!e->b) f =3D h; else f =3D e->a; g =3D &e->d[0]; __builtin_memcpy (g, f, sizeof (float) * 4); bar (); if (!e->b) if (g[0] !=3D 0.0 || g[1] !=3D 0.0 || g[2] !=3D 1.0 || g[3] !=3D 1.0) __builtin_abort (); } int main () { float d[4]; S e =3D { .d =3D d }; foo (&e); return 0; } The optimized dump difference from the previous commit is @@ -23,7 +23,6 @@ Removing basic block 17 __attribute__((optimize (2), noinline)) void foo (struct S * e) { - float h[4]; float * g; const float * f; int _1; @@ -32,10 +31,10 @@ void foo (struct S * e) float _4; float _5; float _6; - uint128_t _13; + uint128_t pretmp_18; + uint128_t prephitmp_19; [local count: 1073741824]: - h =3D *.LC0; _1 =3D e_10(D)->b; if (_1 =3D=3D 0) goto ; [50.00%] @@ -44,12 +43,12 @@ void foo (struct S * e) [local count: 536870912]: f_11 =3D e_10(D)->a; + pretmp_18 =3D MEM [(char * {ref-all})f_11]; [local count: 1073741824]: - # f_7 =3D PHI <&h(2), f_11(3)> + # prephitmp_19 =3D PHI <4575657222473777152(2), pretmp_18(3)> g_12 =3D e_10(D)->d; - _13 =3D MEM [(char * {ref-all})f_7]; - MEM [(char * {ref-all})g_12] =3D _13; + MEM [(char * {ref-all})g_12] =3D prephitmp_19; bar (); _2 =3D e_10(D)->b; if (_2 =3D=3D 0) @@ -89,7 +88,6 @@ void foo (struct S * e) __builtin_abort (); [local count: 1073741824]: - h =3D{v} {CLOBBER(eol)}; return; } 4575657222473777152 is 0x3f8000003f800000 so on big endian that looks reasonable.=