[Bug tree-optimization/21712] missed optimization due with const function and pulling out of loops

rakdver at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sun May 22 21:41:00 GMT 2005


------- 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



More information about the Gcc-bugs mailing list