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



             Bug #: 56934

           Summary: ICE folding a COND_EXPR involving vectors

    Classification: Unclassified

           Product: gcc

           Version: 4.9.0

            Status: UNCONFIRMED

          Severity: normal

          Priority: P3

         Component: middle-end

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: gli...@gcc.gnu.org





typedef long veci __attribute__((vector_size(16)));

veci f(double a, veci b){

  return (a<2)?(b<3):(b!=b);

}



e.cc: In function 'veci f(double, veci)':

e.cc:3:27: internal compiler error: in fold_convert_loc, at fold-const.c:1972

   return (a<2)?(b<3):(b!=b);

                           ^



I think the folding should just be disabled in this case. Even if fold_convert

was taught how to convert scalars to vectors, it would produce a vector {1,1}

instead of {-1,-1} (and it would build a TRUTH_ANDIF_EXPR with vectors). I have

a fix as part of another patch.



An alternative fix would be to make truth_value_p return false for vectors,

which would make us regress on several optimizations I guess.

Reply via email to