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

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

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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
I will have a look.  The following gets rid of undefined behavior and makes it
ICE with -fno-checking as well (but in forwprop then).

struct spa_buffer {
  __UINT32_TYPE__ *metas;
};
void do_port_use_buffers(struct spa_buffer **buffers, void *mem)
{ 
  for (int i = 0; i < 128; i++) {
    void *endptr;
    for (int j = 0; j < 128; j++)
      endptr = (void *)((__UINTPTR_TYPE__)endptr + buffers[i]->metas[j]);
    if (endptr > mem)
      return;
  }
}

Reply via email to