This avoids asking type_for_size for types with sizes for which
no scalar integer mode exists. Instead the following uses
int_mode_for_size to get the same result.
2021-09-27 Richard Biener <rguenther@suse.de>
PR middle-end/102450
* gimple-fold.c (gimple_fold_builtin_memory_op): Avoid using
type_for_size, instead use int_mode_for_size.
return false;
scalar_int_mode mode;
- tree type = lang_hooks.types.type_for_size (ilen * 8, 1);
- if (type
- && is_a <scalar_int_mode> (TYPE_MODE (type), &mode)
+ if (int_mode_for_size (ilen * 8, 0).exists (&mode)
&& GET_MODE_SIZE (mode) * BITS_PER_UNIT == ilen * 8
&& have_insn_for (SET, mode)
/* If the destination pointer is not aligned we must be able
|| (optab_handler (movmisalign_optab, mode)
!= CODE_FOR_nothing)))
{
+ tree type = build_nonstandard_integer_type (ilen * 8, 1);
tree srctype = type;
tree desttype = type;
if (src_align < GET_MODE_ALIGNMENT (mode))