https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93081

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #3)
> (In reply to Richard Biener from comment #2)
> > OK for trunk.
> 
> Except it is wrong if the size(@1) != size(@3).  I Noticed that after I
> created this bug report.  I have a better fix; though I combined it with
> something which really belongs in reassociate rather than in match.pd so I
> am working towards that first to remove the reassociate part.  I am going to
> submit it when stage 1 starts.  I have many BIT_INSERT_EXPR/BIT_FIELD_REF
> improves which I want to submit together.

Note this might be better in reassociate pass anyways.  There we don't need to
have them right next to each other to remove them
That is take:
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized" } */
#define vector __attribute__((__vector_size__(4*sizeof(int)) ))

vector int f(vector int a, int b, int c)
{
  a[0] = b;
  a[1] = b;
  a[0] = c;
  return a;
}
/* { dg-final { scan-tree-dump-times "BIT_INSERT_EXPR" 2 "optimized" } } */
--- CUT ---

Reply via email to