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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
We must have dups for this, the warning relies on something that the IL doesn't
provide. fre4 changes:
   _8 = &MEM[(struct A *)_5 + 8B].strA;
   std::__cxx11::basic_string<char>::_M_assign (_8, &D.113592.strA);

   <bb 3> [local count: 1073741824]:
   _9 = &MEM[(struct A *)_5 + 8B].arr;
-  _31 = &MEM[(struct A *)_5 + 8B];
-  _29 = _31 + 32;
-  _24 = &D.113592 + 33;
-  _21 = _29 - _24;
+  _29 = _8 + 32;
+  _21 = _29 - &MEM <const struct A> [(void *)&D.113592 + 33B];
...
-  vectp.110_64 = &D.113592 + 32;
-  _69 = &MEM[(struct A *)_5 + 8B];
-  vectp.113_68 = _69 + 32;
-  vect__13.111_67 = MEM <const vector(16) char> [(const char *)vectp.110_64];
-  MEM <vector(16) char> [(char *)vectp.113_68] = vect__13.111_67;
-  vectp.109_66 = vectp.110_64 + 16;
-  vectp.112_71 = vectp.113_68 + 16;
-  ivtmp_74 = 1;
+  vect__13.111_67 = MEM <const vector(16) char> [(const char *)&D.113592 +
32B];
+  MEM <vector(16) char> [(char *)_29] = vect__13.111_67;
+  vectp.112_71 = _29 + 16;

and the warning warns because it thinks the store uses the strA + 32 pointer to
store the 16 bytes (vectorized), but the user code doesn't do that, only the
value numbering found that the value is equal to that.

Perhaps SCCVN could try to modify the &something.field into &MEM_REF[..., off]
if it decides to reuse it in some context that doesn't use the same field base,
but not sure how hard would that be.

Reply via email to