[Bug target/108583] [13 Regression] wrong code with vector division by uint16 at -O2

rguenther at suse dot de gcc-bugzilla@gcc.gnu.org
Mon Jan 30 14:52:55 GMT 2023


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108583

--- Comment #4 from rguenther at suse dot de <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=108583
> 
> Tamar Christina <tnfchris at gcc dot gnu.org> changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                  CC|                            |rguenth at gcc dot gnu.org,
>                    |                            |rsandifo at gcc dot gnu.org
> 
> --- Comment #3 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
> Right, so this is because in the expansion we don't have enough context to
> decide how to optimize the division.
> 
> 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.
> 
> The vectorizer has this context but since we didn't want a new IFN the 
> context should instead be derivable in 
> 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?


More information about the Gcc-bugs mailing list