Re: vect: Make vect_check_gather_scatter reject offsets that aren't multiples of BITS_PER_UNIT [PR107346]

2022-10-28 Thread Richard Biener via Gcc-patches
On Fri, 28 Oct 2022, Andre Vieira (lists) wrote: > > On 24/10/2022 14:29, Richard Biener wrote: > > On Mon, 24 Oct 2022, Andre Vieira (lists) wrote: > > > >> Changing if-convert would merely change this testcase but we could still > >> trigger using a different structure type, changing the size

Re: vect: Make vect_check_gather_scatter reject offsets that aren't multiples of BITS_PER_UNIT [PR107346]

2022-10-28 Thread Andre Vieira (lists) via Gcc-patches
On 24/10/2022 14:29, Richard Biener wrote: On Mon, 24 Oct 2022, Andre Vieira (lists) wrote: Changing if-convert would merely change this testcase but we could still trigger using a different structure type, changing the size of Int24 to 32 bits rather than 24: package Loop_Optimization23_Pkg

Re: vect: Make vect_check_gather_scatter reject offsets that aren't multiples of BITS_PER_UNIT [PR107346]

2022-10-24 Thread Richard Biener via Gcc-patches
On Mon, 24 Oct 2022, Andre Vieira (lists) wrote: > > On 24/10/2022 13:46, Richard Biener wrote: > > On Mon, 24 Oct 2022, Andre Vieira (lists) wrote: > > > >> On 24/10/2022 08:17, Richard Biener wrote: > >>> Can you check why vect_find_stmt_data_reference doesn't trip on the > >>> > >>> if

Re: vect: Make vect_check_gather_scatter reject offsets that aren't multiples of BITS_PER_UNIT [PR107346]

2022-10-24 Thread Andre Vieira (lists) via Gcc-patches
On 24/10/2022 13:46, Richard Biener wrote: On Mon, 24 Oct 2022, Andre Vieira (lists) wrote: On 24/10/2022 08:17, Richard Biener wrote: Can you check why vect_find_stmt_data_reference doesn't trip on the if (TREE_CODE (DR_REF (dr)) == COMPONENT_REF && DECL_BIT_FIELD

Re: vect: Make vect_check_gather_scatter reject offsets that aren't multiples of BITS_PER_UNIT [PR107346]

2022-10-24 Thread Richard Biener via Gcc-patches
On Mon, 24 Oct 2022, Andre Vieira (lists) wrote: > > On 24/10/2022 08:17, Richard Biener wrote: > > > > Can you check why vect_find_stmt_data_reference doesn't trip on the > > > >if (TREE_CODE (DR_REF (dr)) == COMPONENT_REF > >&& DECL_BIT_FIELD (TREE_OPERAND (DR_REF (dr), 1))) > >

Re: vect: Make vect_check_gather_scatter reject offsets that aren't multiples of BITS_PER_UNIT [PR107346]

2022-10-24 Thread Andre Vieira (lists) via Gcc-patches
On 24/10/2022 08:17, Richard Biener wrote: Can you check why vect_find_stmt_data_reference doesn't trip on the if (TREE_CODE (DR_REF (dr)) == COMPONENT_REF && DECL_BIT_FIELD (TREE_OPERAND (DR_REF (dr), 1))) { free_data_ref (dr); return opt_result::failure_at

Re: vect: Make vect_check_gather_scatter reject offsets that aren't multiples of BITS_PER_UNIT [PR107346]

2022-10-24 Thread Eric Botcazou via Gcc-patches
> Eric - the docs of DECL_BIT_FIELD are vague enough "must be accessed > specially" but ISTR it might eventually only apply to the fields > (bit) size and not it's position. OTOH the Ada frontend might not > be too careful in setting this flag for bit-packed structs? It sets the flag when the

Re: vect: Make vect_check_gather_scatter reject offsets that aren't multiples of BITS_PER_UNIT [PR107346]

2022-10-24 Thread Richard Biener via Gcc-patches
On Fri, 21 Oct 2022, Andre Vieira (lists) wrote: > Hi, > > The ada failure reported in the PR was being caused by > vect_check_gather_scatter failing to deal with bit offsets that weren't > multiples of BITS_PER_UNIT. This patch makes vect_check_gather_scatter reject > memory accesses with such

vect: Make vect_check_gather_scatter reject offsets that aren't multiples of BITS_PER_UNIT [PR107346]

2022-10-21 Thread Andre Vieira (lists) via Gcc-patches
Hi, The ada failure reported in the PR was being caused by vect_check_gather_scatter failing to deal with bit offsets that weren't multiples of BITS_PER_UNIT. This patch makes vect_check_gather_scatter reject memory accesses with such offsets. Bootstrapped and regression tested on aarch64