This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/78528] Recursion not optimized for structs


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]