https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120072
Bug ID: 120072 Summary: New attribute alloc_variant_zeroed which can be used for alloc+memset->calloc optimization Product: gcc Version: 16.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: pinskia at gcc dot gnu.org Target Milestone: --- Instead of the current hard coded malloc+zero->calloc code. we could have a new attribute which is used for a similar thing for other allocation (xmalloc->xcalloc, etc.). The attribute alloc_variant_zeroed would take 2 arguments: * first argument is the function that zeros. * second argument is optional and is a bool (true/false) meaning adding a new first argument of 1.