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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2019-11-28
     Ever confirmed|0                           |1

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Testcase w/o too excessive alignment (and not relying on __int128):

typedef __UINT64_TYPE__ uint64_t;
typedef __UINT32_TYPE__ uint32_t;
struct S { uint32_t i[2]; } __attribute__((aligned(__alignof__(uint64_t))));
typedef uint64_t my_int64 __attribute__((may_alias));
uint64_t load (void *p)
{
  struct S u, v, w;
  uint64_t tem;
  tem = *(my_int64 *)p;
  *(my_int64 *)&v = tem;
  u = v;
  w = u;
  return *(my_int64 *)&w;
}

nicely showing a case where the total scalarized aggregate doesn't
even go away?!

@@ -20,11 +64,13 @@
   tem_5 = MEM[(my_int64 * {ref-all})p_4(D)];
   MEM[(my_int64 * {ref-all})&v] = tem_5;
   u = v;
-  w = u;
-  _9 = MEM[(my_int64 * {ref-all})&w];
-  u ={v} {CLOBBER};
+  u$i$0_1 = v.i[0];
+  u$i$1_2 = v.i[1];
+  MEM <uint32_t> [(struct S *)&u] = u$i$0_1;
+  MEM <uint32_t> [(struct S *)&u + 4B] = u$i$1_2;
+  w_15 = MEM[(struct S *)&u];
+  _9 = w_15;
   v ={v} {CLOBBER};
-  w ={v} {CLOBBER};
   return _9;

maybe it's because SRA arrives late at the decision to scalarize w?

Reply via email to