> -----Original Message-----
> From: Jakub Jelinek <[email protected]>
> Sent: 26 October 2020 09:32
> To: Kyrylo Tkachov <[email protected]>
> Cc: [email protected]
> Subject: Re: [PATCH] PR tree-optimization/97546 Bail out of
> find_bswap_or_nop on non-INTEGER_CST sizes
> 
> On Mon, Oct 26, 2020 at 09:20:42AM +0000, Kyrylo Tkachov via Gcc-patches
> wrote:
> > This patch fixes the ICE in the PR by bailing out of find_bswap_or_nop on
> poly_int sizes.
> > I don't think it intends to handle them and from my reading of the code it's
> the most appropriate place to reject them
> > here rather than in the callers.
> >
> > Bootstrapped and tested on aarch64-none-linux-gnu.
> >
> > Ok for trunk?
> > Thanks,
> > Kyrill
> >
> > gcc/
> >     PR tree-optimization/97546
> >     * gimple-ssa-store-merging.c (find_bswap_or_nop): Return NULL if
> type is
> >     not INTEGER_CST.
> 
> I think better use tree_fits_uhwi_p instead of cst_and_fits_hwi and
> instead of TREE_INT_CST_LOW use tree_to_uhwi.
> TYPE_SIZE_UNIT which doesn't fit into uhwi but fits into shwi is something
> that really shouldn't appear.
> Otherwise LGTM.

Thanks, that makes sense.
Is the attached patch ok?
Kyrill

> 
> > gcc/testsuite/
> >     PR tree-optimization/97546
> >     * gcc.target/aarch64/sve/acle/general/pr97546.c: New test.
> 
> 
> 
>       Jakub

Attachment: sm-poly.patch
Description: sm-poly.patch

Reply via email to