===================================================================
@@ -217,15 +217,16 @@ cp_convert_to_pointer (tree type, tree e
error ("invalid conversion from %qT to %qT", intype, type);
return error_mark_node;
}
if (INTEGRAL_CODE_P (form))
{
- if (TYPE_PRECISION (intype) == POINTER_SIZE)
+ int this_pointer_size = TYPE_PRECISION (type);
+ if (TYPE_PRECISION (intype) == this_pointer_size)
return build1 (CONVERT_EXPR, type, expr);
- expr = cp_convert (c_common_type_for_size (POINTER_SIZE, 0), expr);
+ expr = cp_convert (c_common_type_for_size (this_pointer_size, 0), expr);
/* Modes may be different but sizes should be the same. There
is supposed to be some integral type that is the same width
as a pointer. */
gcc_assert (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (expr)))
== GET_MODE_SIZE (TYPE_MODE (type)));