From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7994 invoked by alias); 20 Mar 2010 15:00:04 -0000 Received: (qmail 7851 invoked by uid 48); 20 Mar 2010 14:59:44 -0000 Date: Sat, 20 Mar 2010 15:00:00 -0000 Message-ID: <20100320145944.7849.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/40106] [4.4/4.5 Regression] Weird interaction between optimize_insn_for_speed_p and -funsafe-math-optimizations In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rguenth at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-03/txt/msg01972.txt.bz2 ------- 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