public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.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	[thread overview]
Message-ID: <bug-101925-4-bfsj6jhrd3@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-101925-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101925

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|rguenth at gcc dot gnu.org         |unassigned at gcc dot gnu.org
                 CC|                            |jamborm at gcc dot gnu.org
             Status|ASSIGNED                    |NEW

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
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}= _2;
...
      rc.u.addr8[1] {rev}= _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 = D.2017;

(note also no reverse storage marker).  But then SRA comes along and
scalarizes that aggregate copy:

   <bb 3> :
   _3 = ip.u.addr;
-  rc.u.addr {rev}= _3;
+  rc$u$addr_152 = _3;
   goto <bb 5>; [INV]
...
+  rc.u.addr6.u.addr8[0] = SR.48_91;
+  rc.u.addr6.u.addr8[1] = SR.49_92;
+  rc.u.addr6.u.addr8[2] = SR.50_93;
+  rc.u.addr6.u.addr8[3] = SR.51_94;
+  rc.u.addr6.u.addr8[4] = SR.52_95;
+  rc.u.addr6.u.addr8[5] = SR.53_96;
+  rc.u.addr6.u.addr8[6] = SR.54_97;
+  rc.u.addr6.u.addr8[7] = SR.55_98;
+  rc.u.addr6.u.addr8[8] = SR.56_99;
+  rc.u.addr6.u.addr8[9] = SR.57_100;
+  rc.u.addr6.u.addr8[10] = SR.58_101;
+  rc.u.addr6.u.addr8[11] = SR.59_102;
+  rc.u.addr6.u.addr8[12] = SR.60_103;
+  rc.u.addr6.u.addr8[13] = SR.61_104;
+  rc.u.addr6.u.addr8[14] = SR.62_105;
+  rc.u.addr6.u.addr8[15] = SR.63_106;
+  rc$u$addr_123 ={rev} MEM <int32_t> [(union  *)&rc + 4B];
(??)
...
+  rc.is_v4 {rev}= rc$is_v4_74;
+  rc.u.addr {rev}= rc$u$addr_8;
+  MEM <char> [(struct _be_net_addr *)&rc + 8B] = rc$u$addr6$u$addr8$4_47;
+  MEM <char> [(struct _be_net_addr *)&rc + 9B] = rc$u$addr6$u$addr8$5_48;
+  MEM <char> [(struct _be_net_addr *)&rc + 10B] = rc$u$addr6$u$addr8$6_49;
+  MEM <char> [(struct _be_net_addr *)&rc + 11B] = rc$u$addr6$u$addr8$7_50;
+  MEM <char> [(struct _be_net_addr *)&rc + 12B] = rc$u$addr6$u$addr8$8_51;
+  MEM <char> [(struct _be_net_addr *)&rc + 13B] = rc$u$addr6$u$addr8$9_52;
+  MEM <char> [(struct _be_net_addr *)&rc + 14B] = rc$u$addr6$u$addr8$10_53;
+  MEM <char> [(struct _be_net_addr *)&rc + 15B] = rc$u$addr6$u$addr8$11_54;
+  MEM <char> [(struct _be_net_addr *)&rc + 16B] = rc$u$addr6$u$addr8$12_55;
+  MEM <char> [(struct _be_net_addr *)&rc + 17B] = rc$u$addr6$u$addr8$13_56;
+  MEM <char> [(struct _be_net_addr *)&rc + 18B] = rc$u$addr6$u$addr8$14_57;
+  MEM <char> [(struct _be_net_addr *)&rc + 19B] = rc$u$addr6$u$addr8$15_58;
   <retval> = rc;

I'm somewhat lost as to how this works.

  parent reply	other threads:[~2021-08-16 11:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-15 23:43 [Bug c/101925] New: reversed storage order when compiling with -O3 only george.thopas at gmail dot com
2021-08-15 23:50 ` [Bug tree-optimization/101925] " pinskia at gcc dot gnu.org
2021-08-16  8:08 ` [Bug tree-optimization/101925] [10/11/12 Regression] " marxin at gcc dot gnu.org
2021-08-16  8:22 ` [Bug tree-optimization/101925] [10/11/12 Regression] reversed storage order when compiling with -O3 only since r10-4742-g9b75f56d4b7951c6 rguenth at gcc dot gnu.org
2021-08-16  9:27 ` ebotcazou at gcc dot gnu.org
2021-08-16 10:45 ` rguenth at gcc dot gnu.org
2021-08-16 11:20 ` rguenth at gcc dot gnu.org [this message]
2021-08-16 12:20 ` ebotcazou at gcc dot gnu.org
2021-08-16 13:16 ` rguenther at suse dot de
2021-08-16 13:21 ` rguenth at gcc dot gnu.org
2021-08-17  7:25 ` cvs-commit at gcc dot gnu.org
2021-09-06  8:50 ` [Bug tree-optimization/101925] [10/11 " cvs-commit at gcc dot gnu.org
2021-10-13 11:09 ` [Bug tree-optimization/101925] [10 " cvs-commit at gcc dot gnu.org
2021-10-13 11:10 ` rguenth at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-101925-4-bfsj6jhrd3@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).