http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51485

             Bug #: 51485
           Summary: [4.6/4.7 Regression] ICE in vectorizable_statement
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: ja...@gcc.gnu.org
        ReportedBy: ja...@gcc.gnu.org
            Target: x86_64-linux


struct A { A (); unsigned int a; };
double bar (A a) throw () __attribute__((pure));

void
foo (unsigned int x, double *y, A *z)
{
  unsigned int i;
  for (i = 0; i < x; i++)
    y[i] = bar (z[i]);
}

ICEs at -O3, because GIMPLE_CALL has a single data ref (on the argument),
and gets vectype of that (V4SImode).  But later on when determining
vectorization factor we don't look at vectype, but for calls just at
gimple_expr_type, i.e. the DFmode return type of the call and thus we end up
with vectorization factor 2.
And in vectorizable_assignment the vectype has 4 nunits, so we end up with
ncopies 0 and ICE on it.  Of course the call isn't vectorizable, so we should
bail out on it earlier.
Started failing with http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=158157

Reply via email to