From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 80BCD397C873; Fri, 2 Jul 2021 11:12:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 80BCD397C873 From: "gabrielle.hugo at cern dot ch" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/100778] [11 Regression] Get SIGFPE on simple test with -fpe-trap=invalid and SLP vectorization ON, with gfortran 11.1.0 on x86_64 Date: Fri, 02 Jul 2021 11:12:51 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 11.1.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: gabrielle.hugo at cern dot ch X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.2 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jul 2021 11:12:51 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100778 --- Comment #11 from Gabrielle Hugo --- 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 400828: 66 0f 28 d0 movapd %xmm0,%xmm2 x =3D x / norm y =3D y / norm write (*, '(A,F5.3)') 'Normalized x and y.', norm 40082c: 48 8b 05 c5 01 00 00 mov 0x1c5(%rip),%rax # 40= 09f8 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=20 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=20 x =3D x / norm 400850: 66 0f 5e ca divpd %xmm2,%xmm1 So if I understand correctly the fix in SLP vectorization=20 (is_a (vinfo)),=20 when there are possibly trapping operations=20 (gimple_could_trap_p (stmt_info->stmt)),=20 is to explicitely constrain them to come from the same BB=20 (special handling when gimple_bb (last_stmt) !=3D gimple_bb (stmt_info->stm= t) ). 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 relea= se?=