https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77550
Bernd Edlinger <bernd.edlinger at hotmail dot de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bernd.edlinger at hotmail dot de --- Comment #9 from Bernd Edlinger <bernd.edlinger at hotmail dot de> --- I'm unable to reduce the test case... The deque_iterator has these members: _Elt_pointer _M_cur; _Elt_pointer _M_first; _Elt_pointer _M_last; _Map_pointer _M_node; the first 3 elements have alias set 12 while _M_node has alias set 13. when all 4 elements are assigned that becomes 2 vector statements, but all use alias set 12. but _M_node is read back in the loop using alias set 13. and thus it seems _M_node is constant. It can be seen first in expand. _M_node is read without non-vectorized: (insn 290 289 291 44 (set (reg/f:DI 117 [ prephitmp_166 ]) (mem/f/c:DI (plus:DI (reg/f:DI 82 virtual-stack-vars) (const_int -176 [0xffffffffffffff50])) [12 MEM[(struct _Deque_iterator *)&D.66017]._M_last+0 S8 A128])) -1 (nil)) (insn 291 290 292 44 (set (reg/f:DI 149 [ _215 ]) (mem/f/c:DI (plus:DI (reg/f:DI 82 virtual-stack-vars) (const_int -168 [0xffffffffffffff58])) [13 MEM[(struct _Deque_iterator *)&D.66017]._M_node+0 S8 A64])) /var/tmp/gcc_test/usr/local/include/c++/7.0.0/bits/stl_deque.h:173 -1 (nil)) _M_node is written using _M_last's alias set in insn 307: (insn 305 304 306 46 (set (mem/c:V2DI (plus:DI (reg/f:DI 82 virtual-stack-vars) (const_int -192 [0xffffffffffffff40])) [12 MEM[(struct Foo * *)&D.66017]+0 S16 A128]) (reg:V2DI 237)) /var/tmp/gcc_test/usr/local/include/c++/7.0.0/bits/stl_deque.h:174 -1 (nil)) (insn 306 305 307 46 (set (reg:V2DI 238) (vec_concat:V2DI (reg/f:DI 117 [ prephitmp_166 ]) (reg:DI 90 [ _25 ]))) /var/tmp/gcc_test/usr/local/include/c++/7.0.0/bits/stl_deque.h:258 -1 (nil)) (insn 307 306 308 46 (set (mem/c:V2DI (plus:DI (reg/f:DI 82 virtual-stack-vars) (const_int -176 [0xffffffffffffff50])) [12 MEM[(struct Foo * *)&D.66017 + 16B]+0 S16 A128]) (reg:V2DI 238)) /var/tmp/gcc_test/usr/local/include/c++/7.0.0/bits/stl_deque.h:174 -1 (nil))