https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100267
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Keywords| |diagnostic,
| |missed-optimization
Target| |x86_64-*-* i?86-*-*
Ever confirmed|0 |1
Last reconfirmed| |2021-04-27
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
With GCC 9 SRA decomposes pdata and substitutes uninitialized SSA names marked
with no-warning while later we no longer perform this optimization. It's not
exactly clear what _mm256_mask_expand_epi64 does and why you need to feed it
an uninitialized first argument.
The middle-end unfortunately only sees
_41 = MEM[(__m256i * {ref-all})&pdata];
_42 = __builtin_ia32_expanddi256_mask (_29, _41, 15);
where it doesn't know that __builtin_ia32_expanddi256_mask doesn't actually
use the uninitialized value _41 (does it?)
You could use
__m256i pdatau = pdatau;
pdata[0] = _mm256_mask_expand_epi64(pdatau, m[0], nd[0]);
pdata[1] = _mm256_mask_expand_epi64(pdatau, m[1], nd[1]);
to get an uninitialized __m256i and not warn about the missed initialization.
(but I suspect the data might be initialized in other uses)