On Tue, Jul 15, 2014 at 2:33 PM, Bernd Schmidt <bernds_...@t-online.de> wrote: > On 02/28/2014 11:48 PM, Marc Glisse wrote: >> >> /* Optimize >> + ptr = malloc (n); >> + memset (ptr, 0, n); >> + into >> + ptr = calloc (n); >> + gsi_p is known to point to a call to __builtin_memset. */ > > > Is there anything in here to prevent us making an infinite loop if the above > pattern occurs in a function called "calloc"?
Nothing. See how I ended up doing 2014-05-06 Richard Biener <rguent...@suse.de> * c-opts.c (c_common_post_options): For -freestanding, -fno-hosted and -fno-builtin disable pattern recognition if not enabled explicitely. to avoid sth like this for memset/memcpy/memmove recognition. Richard. > > Bernd >