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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
But note that while free() may clobber errno the state after it is undefined
(it's not documented to set it to any specific value).  So I'd argue the
check_errno_unmodified testcase is not really relevant.

A relevant testcase might be

void foo (void *p)
{
  errno = 0;
  free (p);
  errno = 0;
}

where GCC might be tricked into elimiating the late errno = 0 store as
redundant with the earlier (it doesn't do that right now, but I didn't
try too hard but DSE elides the earlier store).

The ensure_errno_unmodified is relevant though.

Reply via email to