https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94905
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |msebor at gcc dot gnu.org Known to fail| |11.2.1 Known to work| |12.0 Keywords| |needs-bisection Last reconfirmed|2020-09-03 00:00:00 |2022-1-21 Summary|[10/11/12 Regression] Bogus |[10/11 Regression] Bogus |warning |warning |-Werror=maybe-uninitialized |-Werror=maybe-uninitialized --- Comment #12 from Richard Biener <rguenth at gcc dot gnu.org> --- The diagnostic is gone with GCC 12 as we there pattern-recognize a memcpy: <bb 2> [local count: 119292720]: insert_axis_len.0_1 = insert_axis_len; ret ={v} {CLOBBER}; ret.rho[0] = insert_axis_len.0_1; __builtin_memcpy (_3(D), &ret, 32); ret ={v} {CLOBBER}; return _3(D); and the partial uninitialized read from it is not what the uninit pass can diagnose (it's memory walking stops at the first may-def, it does not prune must-def ranges). But even with -fno-tree-loop-distribute-patterns -fno-tree-vectorize where we get similar IL as with GCC 11 we do not warn so I wonder what fixed it on trunk (when you add those options).