This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/82732] malloc+zeroing other than memset not optimized to calloc, so asm output is malloc+memset
- From: "law at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 07 Nov 2017 16:40:52 +0000
- Subject: [Bug tree-optimization/82732] malloc+zeroing other than memset not optimized to calloc, so asm output is malloc+memset
- Auto-submitted: auto-generated
- References: <bug-82732-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82732
--- Comment #7 from Jeffrey A. Law <law at redhat dot com> ---
Given that both DOM and strlen are already dom walker based, getting better
range information in them is going to be easy. The former is actually part of
the motivation behind the refactoring work.
We actually don't need to muck around with ASSERT_EXPRs in the IL. THe
analysis is the EVRP bits refactored. So you get a embeddable context
sensitive range analysis that doesn't change the IL. It's just analyzes it as
you walk the dominator tree allowing you to make queries during the walk.
I've done a proof of concept with embedding it into Martin's sprintf work and
it was truly trivial. Martin and I have lightly discussed adding the analysis
to the strlen pass as probably being a high value target once the refactoring
work his the trunk.