/* If INNER_SVALUE is the same size as OUTER_SIZE,
turn into simply a cast. */
- if (tree cst_outer_num_bytes = outer_size->maybe_get_constant ())
- {
- HOST_WIDE_INT num_bytes_inner_svalue
- = int_size_in_bytes (inner_svalue->get_type ());
- if (num_bytes_inner_svalue != -1)
- if (num_bytes_inner_svalue
- == (HOST_WIDE_INT)tree_to_uhwi (cst_outer_num_bytes))
- {
- if (type)
- return get_or_create_cast (type, inner_svalue);
- else
- return inner_svalue;
- }
- }
+ if (inner_svalue->get_type ())
+ if (tree cst_outer_num_bytes = outer_size->maybe_get_constant ())
+ {
+ HOST_WIDE_INT num_bytes_inner_svalue
+ = int_size_in_bytes (inner_svalue->get_type ());
+ if (num_bytes_inner_svalue != -1)
+ if (num_bytes_inner_svalue
+ == (HOST_WIDE_INT)tree_to_uhwi (cst_outer_num_bytes))
+ {
+ if (type)
+ return get_or_create_cast (type, inner_svalue);
+ else
+ return inner_svalue;
+ }
+ }
/* Handle zero-fill of a specific type. */
if (tree cst = inner_svalue->maybe_get_constant ())