[Bug tree-optimization/105051] consider not combining malloc + memset to calloc when inside calloc itself

2022-03-25 Thread godmar at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105051 --- Comment #4 from Godmar Back --- Don't let perfect be the enemy of good. IMO, the detection doesn't need to be perfect in the sense of not having false negatives. All 3 bug reports of the calloc implementations you broke called malloc +

[Bug tree-optimization/105051] consider not combining malloc + memset to calloc when inside calloc itself

2022-03-25 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105051 --- Comment #3 from Richard Biener --- It's more of a QOI issue, we have similar (old) bugs where we pattern-match a memcpy loop to memcpy inside memcpy (PR56888). The difficulty is to reliably detect whether we're in a place where emitting a

[Bug tree-optimization/105051] consider not combining malloc + memset to calloc when inside calloc itself

2022-03-24 Thread godmar at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105051 --- Comment #2 from Godmar Back --- Thank you for your reply. To make sure I understand, the only work-around is to completely disable all builtins (as in -fno-builtin), or is using `-fno-builtin-memset` as I proposed sufficient? I'm not

[Bug tree-optimization/105051] consider not combining malloc + memset to calloc when inside calloc itself

2022-03-24 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105051 Andrew Pinski changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---