From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31781 invoked by alias); 16 Mar 2010 15:11:41 -0000 Received: (qmail 31665 invoked by alias); 16 Mar 2010 15:11:23 -0000 Date: Tue, 16 Mar 2010 15:11:00 -0000 Message-ID: <20100316151123.31664.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: "rguenther at suse dot de" 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/msg01492.txt.bz2 ------- Comment #37 from rguenther at suse dot de 2010-03-16 15:11 ------- Subject: Re: [4.4/4.5 Regression] Weird interaction between optimize_insn_for_speed_p and -funsafe-math-optimizations On Tue, 16 Mar 2010, dominiq at lps dot ens dot fr wrote: > > > ------- Comment #36 from dominiq at lps dot ens dot fr 2010-03-16 15:06 ------- > > Note that the replacement for x**(n/3) * cbrt(x)**(n%3) does not seems guarded > > by any optimisation flag. > > The condition is implemented further down in the code and I missed it: > > if (real_identical (&c2, &c) > && ((optimize_insn_for_speed_p () > && powi_cost (n/3) <= POWI_MAX_MULTS) > || n == 1)) > > Why the condition optimize_insn_for_speed_p () is not part of > > if (fn != NULL_TREE > && flag_unsafe_math_optimizations > && (tree_expr_nonnegative_p (arg0) > || !HONOR_NANS (mode))) > > ? Because we unconditionally want to turn pow (x, 1/3) to cbrt (x) as it is smaller. Richard. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40106