From e3530904e76e650e0df59fed4319749388ac3494 Mon Sep 17 00:00:00 2001 From: Tobias Burnus Date: Fri, 31 May 2013 12:18:40 +0200 Subject: [PATCH] re PR middle-end/57073 (__builtin_powif (-1.0, k) should be optimized to "1.0 - 2.0 * (K%2)") 2013-05-31 Tobias Burnus PR middle-end/57073 * tree-ssa-math-opts.c (execute_cse_sincos): Move check further up. From-SVN: r199529 --- gcc/ChangeLog | 6 ++++++ gcc/tree-ssa-math-opts.c | 10 ++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ff9f38c4672..b0a5ad11e34 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2013-05-31 Tobias Burnus + + PR middle-end/57073 + * tree-ssa-math-opts.c (execute_cse_sincos): Move check + further up. + 2013-05-31 Kyrylo Tkachov PR target/56315 diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c index a15c4042867..b4de411b39d 100644 --- a/gcc/tree-ssa-math-opts.c +++ b/gcc/tree-ssa-math-opts.c @@ -1447,9 +1447,10 @@ execute_cse_sincos (void) arg1 = gimple_call_arg (stmt, 1); loc = gimple_location (stmt); - if (real_minus_onep (arg0) - && TREE_CODE (TREE_TYPE (arg1)) == INTEGER_TYPE - && !host_integerp (arg1,0)) + if (!host_integerp (arg1, 0)) + break; + + if (real_minus_onep (arg0)) { tree t0, t1, cond, one, minus_one; gimple stmt; @@ -1476,9 +1477,6 @@ execute_cse_sincos (void) } else { - if (!host_integerp (arg1, 0)) - break; - n = TREE_INT_CST_LOW (arg1); result = gimple_expand_builtin_powi (&gsi, loc, arg0, n); } -- 2.30.2