This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/68008] Pessimization of simple non-tail-recursive functions
- 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: Sun, 18 Oct 2015 13:54:53 +0000
- Subject: [Bug tree-optimization/68008] Pessimization of simple non-tail-recursive functions
- Auto-submitted: auto-generated
- References: <bug-68008-4 at http dot gcc dot gnu dot org/bugzilla/>
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.