On Wed, Mar 30, 2016 at 02:07:07PM +0200, Richard Biener wrote:
> The patch for PR63764 (accepts-invalid / ICE) caused us to generate
> worse code for rvalue vector indexing by forcing the vector to a
> temporary.  It turns out this is not necessary if we alter the
> way the C/C++ FE lower the vector to perform the indexing operation
> from lowering to a pointer-to-element to lowering to an array
> using a VIEW_CONVERT_EXPR.
> 
> The alternate lowering has the advantage that the vector is not
> required to be addressable which should improve aliasing analysis.
> Not lowering to indirect accesses should also improve optimizations
> like value-numbering.
> 
> There's the fallout that we need to make sure to convert back
> constant index array-refs to the canonical BIT_FIELD_REF form
> we use for vectors (see the gimple-fold.c hunk pattern-matching this).
> 
> And there's the latent bug in update-address-taken which happily
> re-wrote a vector array-ref base into SSA form.
> 
> Bootstrapped on x86_64-unknown-linux-gnu, testing still in progress.
> 
> I'll happily defer to stage1 if you think that's better as I don't
> know any project that heavily makes use of GCCs vector extension
> and I'm not sure about our own testsuite coverage.

I think we should defer it for stage1 at this point.

> 2016-03-30  Richard Biener  <rguent...@suse.de>
> 
>       PR middle-end/70434
>       c-family/
>       * c-common.c (convert_vector_to_pointer_for_subscript): Use a
>       VIEW_CONVERT_EXPR to an array type.
> 
>       * tree-ssa.c (non_rewritable_mem_ref_base): Make sure to mark
>       bases which are accessed with non-invariant indices.
>       * gimple-fold.c (maybe_canonicalize_mem_ref_addr): Re-write
>       constant index ARRAY_REFs of vectors into BIT_FIELD_REFs.

        Jakub

Reply via email to