Commit e3530904 by Tobias Burnus Committed by Tobias Burnus

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  <burnus@net-b.de>

        PR middle-end/57073
        * tree-ssa-math-opts.c (execute_cse_sincos): Move check
        further up.

From-SVN: r199529
parent 2bdf1c75
2013-05-31 Tobias Burnus <burnus@net-b.de>
PR middle-end/57073
* tree-ssa-math-opts.c (execute_cse_sincos): Move check
further up.
2013-05-31 Kyrylo Tkachov <kyrylo.tkachov@arm.com> 2013-05-31 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
PR target/56315 PR target/56315
......
...@@ -1447,9 +1447,10 @@ execute_cse_sincos (void) ...@@ -1447,9 +1447,10 @@ execute_cse_sincos (void)
arg1 = gimple_call_arg (stmt, 1); arg1 = gimple_call_arg (stmt, 1);
loc = gimple_location (stmt); loc = gimple_location (stmt);
if (real_minus_onep (arg0) if (!host_integerp (arg1, 0))
&& TREE_CODE (TREE_TYPE (arg1)) == INTEGER_TYPE break;
&& !host_integerp (arg1,0))
if (real_minus_onep (arg0))
{ {
tree t0, t1, cond, one, minus_one; tree t0, t1, cond, one, minus_one;
gimple stmt; gimple stmt;
...@@ -1476,9 +1477,6 @@ execute_cse_sincos (void) ...@@ -1476,9 +1477,6 @@ execute_cse_sincos (void)
} }
else else
{ {
if (!host_integerp (arg1, 0))
break;
n = TREE_INT_CST_LOW (arg1); n = TREE_INT_CST_LOW (arg1);
result = gimple_expand_builtin_powi (&gsi, loc, arg0, n); result = gimple_expand_builtin_powi (&gsi, loc, arg0, n);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment