From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0B4C338618EE; Tue, 4 Aug 2020 13:49:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0B4C338618EE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1596548941; bh=PM0hvkGiDcscx98ybHEIbVHMyoUeI+RZlkbX/SAcO2w=; h=From:To:Subject:Date:In-Reply-To:References:From; b=QmWq4nllblqA24l/swmhkjn7G8x0KZXAs29h3SsWzEI9ejDE0s2yZYUGggQl26NLh V2vgCVrwA2mTCbYs+P9oNAwVShbqon/JvPp4cF4Sr8TYjpMd/5AButJAx86DonBbc2 kNScYiyLPWpTJVEJryBjkHWKTZM8ehptnJknMAig= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/96373] SVE miscompilation on vectorized division loop, leading to FP exception Date: Tue, 04 Aug 2020 13:49:00 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 10.2.1 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rsandifo at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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: Tue, 04 Aug 2020 13:49:01 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96373 --- Comment #2 from Richard Biener --- (In reply to rsandifo@gcc.gnu.org from comment #1) > I could have sworn there was a reason why we didn't do this, > on the basis that we already failed to take FP exceptions into > account when vectorising normal gassigns. But I can't remember > what the reason was now, or find any notes about it. :-( Well, we refuse to if-convert a stmt that can possibly trap. whilelo is like "if-conversion" here. Not sure what's the reason to ever excempt stmts from the while mask. > Anyway, we have all the infrastructure to do it, so it should > be easy to fix. So for if-conversion it is if ((! gimple_vuse (stmt) || gimple_could_trap_p_1 (stmt, false, false) || ! ifcvt_memrefs_wont_trap (stmt, refs)) && gimple_could_trap_p (stmt)) { if (ifcvt_can_predicate (stmt)) { gimple_set_plf (stmt, GF_PLF_2, true); need_to_predicate =3D true; return true; which means for non-memory gimple_could_trap_p (stmt) - sth you can easily check I guess.=