https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100778
--- Comment #11 from Gabrielle Hugo <gabrielle.hugo at cern dot ch> --- Awesome, thanks a lot Richard! Applying your patch in tree-vect-slp.c to gcc 11, I now get the vectorized division divpd after the if as expected: if (norm .gt. 1.D+00) then 400826: 76 7b jbe 4008a3 <normalize_+0xb3> 400828: 66 0f 28 d0 movapd %xmm0,%xmm2 x = x / norm y = y / norm write (*, '(A,F5.3)') 'Normalized x and y.', norm 40082c: 48 8b 05 c5 01 00 00 mov 0x1c5(%rip),%rax # 4009f8 <options.2.0+0x28> 400833: 48 8d 6c 24 10 lea 0x10(%rsp),%rbp 400838: 48 c7 44 24 18 78 09 movq $0x400978,0x18(%rsp) 40083f: 40 00 400841: 66 0f 14 d2 unpcklpd %xmm2,%xmm2 400845: 48 89 ef mov %rbp,%rdi 400848: c7 44 24 20 1d 00 00 movl $0x1d,0x20(%rsp) 40084f: 00 x = x / norm 400850: 66 0f 5e ca divpd %xmm2,%xmm1 So if I understand correctly the fix in SLP vectorization (is_a <bb_vec_info> (vinfo)), when there are possibly trapping operations (gimple_could_trap_p (stmt_info->stmt)), is to explicitely constrain them to come from the same BB (special handling when gimple_bb (last_stmt) != gimple_bb (stmt_info->stmt) ). Do I understand correctly that trunk is basically gcc 12.0, which will eventually end up being released as gcc 12.1 ? What about gcc 11, will this fix also make its way to the next gcc 11 release?