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: "rakdver at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 May 2005 21:41:05 -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 rakdver at gcc dot gnu dot org 2005-05-22 21:41 -------
As for why we move the division -- most of the time, the behavior described
below will not happen. So if we have a reasonable estimate on how long the
moved calculation may take (which we have with division), we risk it and move
the computation speculatively even if we are not sure whether it will be
executed or not.
However the function call may spent arbitrary amount of time, which may be a
problem. Furthermore, some programs use more benevolent definitions of "const"
and "pure" that cause correctness problems in case non-executed call becomes
executed, see PR19828.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21712