https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119325
--- Comment #19 from Tobias Burnus <burnus at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #15)
> maybe
>
> #define RESIZE_VECTOR(to_t, from) \
> ({ \
> __auto_type __from = (from); \
> to_t __to;
> memcpy (&__to, &__from, MIN (sizeof (to_t), sizeof (from))); \
> __to; \
> })
It didn't like memcpy (w/o adding an '#include') or MIN. Hence, I used:
__builtin_memcpy (&__to, &__from, \
sizeof (to_t) < sizeof (from) \
? sizeof (to_t) : sizeof (from)); \
This gives, e.g., the optimized dump (-O2):
__result_17 = v64sf_fmodf_aux (__to_8, __to_11, _14);
_18 = BIT_FIELD_REF <__result_17, 256, 0>;
__to_19 = VIEW_CONVERT_EXPR<v8sf>(_18);
return __to_19;
And I see the assembler (possibly not for the same line of code):
s_getpc_b64 s[12:13]
s_add_u32 s12, s12, v64sf_fmodf_aux@rel32@lo+4
s_addc_u32 s13, s13, v64sf_fmodf_aux@rel32@hi+4
s_swappc_b64 s[18:19], s[12:13]
s_add_u32 s12, s14, 1016
s_addc_u32 s13, s15, 0
s_mov_b64 exec, -1
v_lshlrev_b32 v4, 2, v1
v_add_co_u32 v4, s[22:23], s12, v4
v_mov_b32 v5, s13