------- Comment #54 from rguenth at gcc dot gnu dot org  2010-03-20 14:59 
-------
(In reply to comment #53)
> > optimize_function_for_size_p (cfun) is true if attribute(cold) is set
> > on it or we are optimizing for size.
> 
> It is what is presently implemented. As a consequence (illustrated by this 
> pr),
> optimize for speed is not obeyed if attribute(cold) is set on. I don't see the
> interest of that: If I want optimization for speed, I just want it.
> 
> From comment #47, I got the impression that the intended behavior is the
> following:
> if optimized for size is on (-Os) then it is overridden if the block is marked
> as "hot" (it is not clear for me that it is !attribute(cold)). From this
> impression the truth table I expect is the following for
> optimize_function_for_size_p:
> 
> "hot"        0      1
> -Os         1      0
> -O[1-3]  0     0
> 
> and not
> 
> "cold"       0    1
> -Os          1    1
> -O[1-3]  0    1
> 
> as presently implemented.

The intent is

           "hot" "cold" nothing
  -Os        0      1     1
  -O[1-3]    0      1     0

implemented is as far as I see

           "hot" "cold" nothing
  -Os        1      1     1
  -O[1-3]    0      1     0

thus optimize_function_for_{size,speed}_p fully correct for -O[1-3].


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40106

Reply via email to