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/68008] Pessimization of simple non-tail-recursive functions


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68008

--- Comment #1 from Marc Glisse <glisse at gcc dot gnu.org> ---
Probably not related, but at -O2, I notice that sccp produces the
"interesting":

  _3 = n_4(D) + -2;
  _12 = (unsigned int) n_4(D);
  _10 = _12 + 4294967294;
  _2 = _10 / 2;
  _11 = (int) _2;
  _9 = _11 * -2;
  _17 = _3 + _9;

(n is of type int)
which we don't simplify at gimple level (looks like we do in RTL).

Even with the X+(X/Y)*-Y thing that is in review (and assuming it supports
convert in the right places, which may not be the case), it would require at
least CSE-ing _10 to (unsigned int) _3. Well, maybe since 2 is a power of 2, we
could simplify _9 = _10 & -2; and depending on which representation is
preferred, (n-2)&-2 might become (n&-2)-2 and we might eventually get there,
but that would be very fragile.


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