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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2018-10-31
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Cleaned up:
int c;

void
foo (int *b)
{
  int e;
  for (e = 0; e < 16; ++e)
    b[e] = c >> e * 8;
}

The testcase with UB in it if the function is ever called has the loop unrolled
by cunroll and we end up with out of bound shifts.  Store-merging should just
punt in that case.

Reply via email to