From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 95B993858C83; Tue, 31 Jan 2023 11:39:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 95B993858C83 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675165142; bh=Wj5IFnvnr0/4xznXpMIhALaUsTVW+GbTWbHufh7KmT0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=iAFaSGN2RYg7nvHt0YqTYXmuEVgBUq2rvIU/X0VNMNpX4ioUTWpBD+2rsgeV/TjRV cWIgJdQpkmxyW63VIUqWbaALEBhgaZEKLTKq+TQDGQv2+b91nnEIJjY9Q6nifatUUV axkAhvycN2NfB94SDjRjD3h06ev5sUs2o/pt2JLU= From: "tnfchris at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/108583] [13 Regression] wrong code with vector division by uint16 at -O2 Date: Tue, 31 Jan 2023 11:39:01 +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: 13.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: tnfchris at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: tnfchris at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108583 --- Comment #10 from Tamar Christina --- (In reply to rsandifo@gcc.gnu.org from comment #9) > Are we sure this is a vectoriser vs. C vectors thing? it's not, the issue we're debating is how to fix it. As Richi pointed out https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108583#= c4 we can fix the vectorizer case by adding a guard around the recog code in the vectorizer. But that only fixes the vectorizer, and Richi asked why that wasn't enough,= to which I pointed out it's because intrinsics code hits it as well. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108583#c5 This is why I mentioned that there are two ways to fix this: 1. We make the hook less general, and add checks in every place it is calle= d. 2. We keep the hook general and pass enough context to the hook for it to decide how to optimize the division. it's not intrinsics only, but a vectorizer only fix won't fix intrinsics.=