From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 46385383B433; Mon, 16 Aug 2021 11:20:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 46385383B433 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/101925] [10/11/12 Regression] reversed storage order when compiling with -O3 only since r10-4742-g9b75f56d4b7951c6 Date: Mon, 16 Aug 2021 11:20: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: 12.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: assigned_to cc bug_status 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 11:20:42 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101925 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|rguenth at gcc dot gnu.org |unassigned at gcc d= ot gnu.org CC| |jamborm at gcc dot gnu.org Status|ASSIGNED |NEW --- Comment #6 from Richard Biener --- Interestingly when I use struct _be_ip6_addr { union { short addr8[16]; } BIG_ENDIAN u; } BIG_ENDIAN; (note 'short' instead of 'char') I _do_ get rc.u.addr8[0] {rev}=3D _2; ... rc.u.addr8[1] {rev}=3D _4; ... so either the testcase is bogus or I fail to capture the desired semantics here. We do end up with aggregate copies here after inlining: rc.u.addr6 =3D D.2017; (note also no reverse storage marker). But then SRA comes along and scalarizes that aggregate copy: : _3 =3D ip.u.addr; - rc.u.addr {rev}=3D _3; + rc$u$addr_152 =3D _3; goto ; [INV] ... + rc.u.addr6.u.addr8[0] =3D SR.48_91; + rc.u.addr6.u.addr8[1] =3D SR.49_92; + rc.u.addr6.u.addr8[2] =3D SR.50_93; + rc.u.addr6.u.addr8[3] =3D SR.51_94; + rc.u.addr6.u.addr8[4] =3D SR.52_95; + rc.u.addr6.u.addr8[5] =3D SR.53_96; + rc.u.addr6.u.addr8[6] =3D SR.54_97; + rc.u.addr6.u.addr8[7] =3D SR.55_98; + rc.u.addr6.u.addr8[8] =3D SR.56_99; + rc.u.addr6.u.addr8[9] =3D SR.57_100; + rc.u.addr6.u.addr8[10] =3D SR.58_101; + rc.u.addr6.u.addr8[11] =3D SR.59_102; + rc.u.addr6.u.addr8[12] =3D SR.60_103; + rc.u.addr6.u.addr8[13] =3D SR.61_104; + rc.u.addr6.u.addr8[14] =3D SR.62_105; + rc.u.addr6.u.addr8[15] =3D SR.63_106; + rc$u$addr_123 =3D{rev} MEM [(union *)&rc + 4B]; (??) ... + rc.is_v4 {rev}=3D rc$is_v4_74; + rc.u.addr {rev}=3D rc$u$addr_8; + MEM [(struct _be_net_addr *)&rc + 8B] =3D rc$u$addr6$u$addr8$4_47; + MEM [(struct _be_net_addr *)&rc + 9B] =3D rc$u$addr6$u$addr8$5_48; + MEM [(struct _be_net_addr *)&rc + 10B] =3D rc$u$addr6$u$addr8$6_4= 9; + MEM [(struct _be_net_addr *)&rc + 11B] =3D rc$u$addr6$u$addr8$7_5= 0; + MEM [(struct _be_net_addr *)&rc + 12B] =3D rc$u$addr6$u$addr8$8_5= 1; + MEM [(struct _be_net_addr *)&rc + 13B] =3D rc$u$addr6$u$addr8$9_5= 2; + MEM [(struct _be_net_addr *)&rc + 14B] =3D rc$u$addr6$u$addr8$10_= 53; + MEM [(struct _be_net_addr *)&rc + 15B] =3D rc$u$addr6$u$addr8$11_= 54; + MEM [(struct _be_net_addr *)&rc + 16B] =3D rc$u$addr6$u$addr8$12_= 55; + MEM [(struct _be_net_addr *)&rc + 17B] =3D rc$u$addr6$u$addr8$13_= 56; + MEM [(struct _be_net_addr *)&rc + 18B] =3D rc$u$addr6$u$addr8$14_= 57; + MEM [(struct _be_net_addr *)&rc + 19B] =3D rc$u$addr6$u$addr8$15_= 58; =3D rc; I'm somewhat lost as to how this works.=