This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/21712] missed optimization due with const function and pulling out of loops
- From: "dberlin at dberlin dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 May 2005 21:56:29 -0000
- Subject: [Bug tree-optimization/21712] missed optimization due with const function and pulling out of loops
- References: <20050522191803.21712.TazForEver@dlfp.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From dberlin at gcc dot gnu dot org 2005-05-22 21:56 -------
Subject: Re: missed optimization due with
const function and pulling out of loops
On Sun, 2005-05-22 at 21:36 +0000, rakdver at gcc dot gnu dot org wrote:
> ------- Additional Comments From rakdver at gcc dot gnu dot org 2005-05-22 21:36 -------
> Do you still believe we should move gettype2 out of the loop???
Okay, let's compromise.
If i move cgraph do noreturn and infinite loop detection, so that we
know everything we can about do_something and gettype2 that is possible,
and we detect neither for do_something, are you still going to claim
that we shouldn't move it out of the loop?
ISTM that presuming a call in a loop is incredibly expensive seems
wrong, when that call is const. Your case seems the very extreme corner
case, not the common case.
People mark const on simple calls (remember, const can't read from
anything but readonly memory), not huge monster calls that do lots of
stuff.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21712