Re: [PATCH] fold-const: Fix up fold_read_from_vector [PR100887]

2021-06-06 Thread Richard Biener
On Fri, 4 Jun 2021, Jakub Jelinek wrote: > On Fri, Jun 04, 2021 at 04:06:43PM +0200, Richard Biener wrote: > > On June 4, 2021 10:44:42 AM GMT+02:00, Jakub Jelinek > > wrote: > > >Hi! > > > > > >The callers of fold_read_from_vector expect that the index they pass is > > >an index of an element i

Re: [PATCH] fold-const: Fix up fold_read_from_vector [PR100887]

2021-06-04 Thread Jakub Jelinek via Gcc-patches
On Fri, Jun 04, 2021 at 04:21:41PM +0200, Jakub Jelinek wrote: > but if the permutation was e.g. > { 0, 13, 2, 3, 4, 5, 6, 7 } > then it would be called with 5 as index and it could see that > it is in the second half (aka. the { 0, 0, 0, 0 } constructor) and > read the 5-4 element from there. Not

Re: [PATCH] fold-const: Fix up fold_read_from_vector [PR100887]

2021-06-04 Thread Jakub Jelinek via Gcc-patches
On Fri, Jun 04, 2021 at 04:06:43PM +0200, Richard Biener wrote: > On June 4, 2021 10:44:42 AM GMT+02:00, Jakub Jelinek wrote: > >Hi! > > > >The callers of fold_read_from_vector expect that the index they pass is > >an index of an element in the vector and the function does that most of > >the > >t

Re: [PATCH] fold-const: Fix up fold_read_from_vector [PR100887]

2021-06-04 Thread Richard Biener
On June 4, 2021 10:44:42 AM GMT+02:00, Jakub Jelinek wrote: >Hi! > >The callers of fold_read_from_vector expect that the index they pass is >an index of an element in the vector and the function does that most of >the >time. But we allow CONSTRUCTORs with VECTOR_TYPE to have VECTOR_TYPE >elements

[PATCH] fold-const: Fix up fold_read_from_vector [PR100887]

2021-06-04 Thread Jakub Jelinek via Gcc-patches
Hi! The callers of fold_read_from_vector expect that the index they pass is an index of an element in the vector and the function does that most of the time. But we allow CONSTRUCTORs with VECTOR_TYPE to have VECTOR_TYPE elements and in that case every CONSTRUCTOR element represents not just one