This avoids using an integer type for which we don't have an
approprate mode when expanding .DEFERRED_INIT to a non-memory
entity.
2021-10-11 Richard Biener <rguenther@suse.de>
PR middle-end/102683
* internal-fn.c (expand_DEFERRED_INIT): Check for mode
availability before building an integer type for storage
purposes.
tree init;
if (tree_fits_uhwi_p (var_size)
&& (init_type == AUTO_INIT_PATTERN
- || !is_gimple_reg_type (var_type)))
+ || !is_gimple_reg_type (var_type))
+ && int_mode_for_size (tree_to_uhwi (var_size) * BITS_PER_UNIT,
+ 0).exists ())
{
unsigned HOST_WIDE_INT total_bytes = tree_to_uhwi (var_size);
unsigned char *buf = (unsigned char *) xmalloc (total_bytes);