+2020-01-31 Andrew Stubbs <ams@codesourcery.com>
+
+ * tree-ssa-loop-ivopts.c (get_iv): Use sizetype for zero-step.
+ (find_inv_vars_cb): Likewise.
+
2020-01-31 David Malcolm <dmalcolm@redhat.com>
* calls.c (special_function_p): Split out the check for DECL_NAME
if (!bb
|| !flow_bb_inside_loop_p (data->current_loop, bb))
- set_iv (data, var, var, build_int_cst (type, 0), true);
+ {
+ if (POINTER_TYPE_P (type))
+ type = sizetype;
+ set_iv (data, var, var, build_int_cst (type, 0), true);
+ }
}
return name_info (data, var)->iv;
if (!bb || !flow_bb_inside_loop_p (idata->current_loop, bb))
{
- set_iv (idata, op, op, build_int_cst (TREE_TYPE (op), 0), true);
+ tree steptype = TREE_TYPE (op);
+ if (POINTER_TYPE_P (steptype))
+ steptype = sizetype;
+ set_iv (idata, op, op, build_int_cst (steptype, 0), true);
record_invariant (idata, op, false);
}
}