From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C25923858D1E; Mon, 30 Jan 2023 14:52:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C25923858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675090375; bh=QGDATR99uGyc7XnNHcVfe1oLSglkQ9BcUIvG/b+W6wE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ootBqzvix8ZppL97kLnRaaPYY9tn26RuINE7yfgwxBxWS3gX3w9GfMUt/hxEI4pCR P4DRqxvKuzLOgUrqGIYcU/i9LfePTV0lgc4A5L8w8stz2p5m3PF9CGOC97plvF8tPX m5UMfPSsy5pqppR4hDDf1+vgoEOpaCkjbfJ9Vtgk= From: "rguenther at suse dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/108583] [13 Regression] wrong code with vector division by uint16 at -O2 Date: Mon, 30 Jan 2023 14:52:55 +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: rguenther at suse dot de 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 #4 from rguenther at suse dot de --- On Mon, 30 Jan 2023, tnfchris at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108583 >=20 > Tamar Christina changed: >=20 > What |Removed |Added > -------------------------------------------------------------------------= --- > CC| |rguenth at gcc dot gnu.o= rg, > | |rsandifo at gcc dot gnu.= org >=20 > --- Comment #3 from Tamar Christina --- > Right, so this is because in the expansion we don't have enough context to > decide how to optimize the division. >=20 > This optimization is only possible when the input is widened because you = need > an additional free bit so that the second addition can't overflow. >=20 > The vectorizer has this context but since we didn't want a new IFN the=20 > context should instead be derivable in=20 > targetm.vectorize.can_special_div_by_const hook. The vectorizer doesn't check for a widened operand zero. In fact "can_special_div_by_const" doesn't suggest that widening is required. If the vectorizer checks that then why do we need another operand?=