This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/78528] Recursion not optimized for structs
- From: "glisse at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 28 Nov 2016 09:42:45 +0000
- Subject: [Bug tree-optimization/78528] Recursion not optimized for structs
- Auto-submitted: auto-generated
- References: <bug-78528-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78528
--- Comment #4 from Marc Glisse <glisse at gcc dot gnu.org> ---
<bb 3>:
MEM[(struct &)&D.2329] ={v} {CLOBBER};
D.2329.m_value = 0;
goto <bb 5>;
<bb 4>:
_2 = s_5(D) + 1;
D.2336 = mystrlen (_2);
lhs$m_value_7 = MEM[(struct Int *)&D.2336];
_8 = lhs$m_value_7 + 1;
MEM[(struct Int *)&D.2329] = _8;
<bb 5>:
return D.2329;
I think the 2 writes to D.2329 could be moved to bb 5, where we would have PHI
<0(3), _8(4)>. That would already make it look slightly more similar to the int
case, although it is unlikely that would suffice.
If strlen was static, we could also imagine gcc cloning it to a function with a
scalarized return type of int.