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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
here is another testcase:

```
typedef int type;

#define size (1024)
type *foo ()
{
  type *p = (type *)__builtin_malloc (size*sizeof(type));
  type tmp[size] = {};
  __builtin_memcpy(p,tmp,sizeof(tmp));
  return p;
}
```

Which will be closer to the IR for after PR 36602.

strlen_pass::handle_builtin_memset is the only place which does the
malloc->calloc transformation. 

I will try my hand at implementing this tomorrow.

Reply via email to