On Tue, Jun 25, 2019 at 4:41 AM Jakub Jelinek <ja...@redhat.com> wrote:
> As mentioned in the PR, the following testcase ICEs starting with
> r272430.  The problem is that if cxx_eval_array_reference is called with
> lval true, we just want to constant evaluate the index and array, but need
> to keep the ARRAY_REF or possibly new one with updated operands in the IL.
> The code to look through VCEs from VECTOR_TYPEs has been previously in the
> !lval section, but has been made unconditional in that change.
> For !lval, we want that, we don't reconstruct ARRAY_REF, but want to fold it
> into a constant.  For lval, we only use ary in:
>   if (lval && ary == oldary && index == oldidx)
>     return t;
>   else if (lval)
>     return build4 (ARRAY_REF, TREE_TYPE (t), ary, index, NULL, NULL);
> though, so if we look through the VCE, we both for vectors can never reuse
> t and build always a new ARRAY_REF, but futhermore build a wrong one,
> as ARRAY_REF should always apply to an object with ARRAY_TYPE, not
> VECTOR_TYPE.
>
> Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for
> trunk?

OK.

Jason

Reply via email to