@@ -1,5 +1,12 @@
2014-11-03 David Malcolm <dmalcolm@redhat.com>
+ * tree-call-cdce.c (check_pow): Replace check against
+ GIMPLE_ASSIGN with a dyn_cast, strengthening local "base_def" from
+ gimple to gassign *.
+ (gen_conditions_for_pow_int_base): Add a checked cast.
+
+2014-11-03 David Malcolm <dmalcolm@redhat.com>
+
* tree-affine.c (aff_combination_expand): Replace is_gimple_assign
with a dyn_cast, strengthening local "def" from gimple to
gassign *.
@@ -223,13 +223,13 @@ check_pow (gcall *pow_call)
else if (bc == SSA_NAME)
{
tree base_val0, type;
- gimple base_def;
+ gassign *base_def;
int bit_sz;
/* Only handles cases where base value is converted
from integer values. */
- base_def = SSA_NAME_DEF_STMT (base);
- if (gimple_code (base_def) != GIMPLE_ASSIGN)
+ base_def = dyn_cast <gassign *> (SSA_NAME_DEF_STMT (base));
+ if (!base_def)
return false;
if (gimple_assign_rhs_code (base_def) != FLOAT_EXPR)
@@ -474,7 +474,7 @@ gen_conditions_for_pow_int_base (tree base, tree expn,
inp_domain exp_domain;
base_def = SSA_NAME_DEF_STMT (base);
- base_val0 = gimple_assign_rhs1 (base_def);
+ base_val0 = gimple_assign_rhs1 (as_a <gassign *> (base_def));
int_type = TREE_TYPE (base_val0);
bit_sz = TYPE_PRECISION (int_type);
gcc_assert (bit_sz > 0