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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
          Component|c++                         |tree-optimization
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot 
gnu.org
   Target Milestone|---                         |8.3

--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> ---
--param vect-max-version-for-alias-checks=0 also avoids the issue.  So it's

/usr/include/c++/8/bits/stl_uninitialized.h:82:23: note: loop vectorized
/usr/include/c++/8/bits/stl_uninitialized.h:82:23: note: loop versioned for
vectorization because of possible aliasing

that breaks things.  This is vectorizing of

  <bb 14> [local count: 163894221]:
  # __first$_M_current_62 = PHI <_100(82), _84(86)>
  # __cur_12 = PHI <iftmp.6_113(82), __cur_85(86)>
  MEM[(struct  &)__cur_12] ={v} {CLOBBER};
  MEM[(struct  &)__cur_12] ={v} {CLOBBER};
  _82 = MEM[(int * const &)__first$_M_current_62];
  MEM[(int * &)__first$_M_current_62] = 0B;
  MEM[(struct  &)__cur_12] ={v} {CLOBBER};
  MEM[(struct _Head_base *)__cur_12]._M_head_impl = _82;
  _83 = __first$_M_current_62->second;
  __cur_12->second = _83;
  _84 = __first$_M_current_62 + 16;
  __cur_85 = __cur_12 + 16;
  if (_67 != _84)
    goto <bb 86>; [89.00%]
  else
    goto <bb 80>; [11.00%]

  <bb 86> [local count: 145865857]:
  goto <bb 14>; [100.00%]

where we end up interchanging the read and write from/to MEM[(int * const
&)__first$_M_current_62].  There are SLP and non-SLP stmts here,
the SLP ones being

stl_uninitialized.h:82:23: note: Final SLP tree for instance:
stl_uninitialized.h:82:23: note: node
stl_uninitialized.h:82:23: note:        stmt 0 MEM[(struct _Head_base
*)__cur_12]._M_head_impl = _82;
stl_uninitialized.h:82:23: note:        stmt 1 __cur_12->second = _83;
stl_uninitialized.h:82:23: note: node
stl_uninitialized.h:82:23: note:        stmt 0 _82 = MEM[(int * const
&)__first$_M_current_62];
stl_uninitialized.h:82:23: note:        stmt 1 _83 =
__first$_M_current_62->second;

Reply via email to