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

prathamesh3492 at gcc dot gnu.org changed:

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

--- Comment #1 from prathamesh3492 at gcc dot gnu.org ---
Hi Martin,
Just wondering if it's necessary for 3rd arg to be sizeof ?
IIUC memset (a, 0, n) for valid n, should result in strlen(a) equal to 0 ?

Btw, it seems, the comparison is folded to 0 in following case:

extern char a4[4];

void g ()
{
  __builtin_memset (a4, 0, sizeof a4);
  if (__builtin_strlen (a4) != 0)
    __builtin_abort ();
}

.optimized dump shows only call to memset.

Thanks,
Prathamesh

Reply via email to