https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122793

--- Comment #15 from Richard Sandiford <rsandifo at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #14)
> (In reply to Richard Biener from comment #13)
> OK, so this miscompiles
> 
> void __attribute__((noipa)) test_hi (v4si *dst, v8si src)
> {
>   (*dst)[0] = src[4];
>   (*dst)[1] = src[5];
>   (*dst)[2] = src[6];
>   (*dst)[3] = src[7];
> }
> 
> because for highpart/lowpart extraction we pass first_def == second_def
> but the can_div_trunc computes to use the seconmd_def and thinks the offset
> is accounted for - it divides 4 (the offset) by 4 (nunits of the result).
> In this case it should divide by 8 (nunits of first_def) I think.
> 
> Adjusting accordingly and re-testing.
Oops, yes.  Thanks for taking care of it.

Reply via email to