This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: AltiVec support toasted in HEAD


Am Fre, 2002-07-05 um 19.13 schrieb Aldy Hernandez:

> if you can't provide a testcase, then perhaps you can debug it on your
> environment.  hack zero_constant() to abort when CONST0_RTX(mode) is not 
> true, but the vector elements are all zero.  then break on the abort,
> go up the call chain and you'll end up with the culprit who created this
> nonsense.

Assuming this trivial implementation is about what you had in mind and
correct:

int
zero_constant (op, mode)
     rtx op;
     enum machine_mode mode;
{
  rtx elt;
  int units, i;
  int allzero = 1;
  
  if (!CONST0_RTX (mode))
  {
    printf ("Possibly not constant 0\n");
    units = CONST_VECTOR_NUNITS (op);

    /* We can generate 0 easily.  Look for that.  */
    for (i = 0; i < units; ++i)
    {
      elt = CONST_VECTOR_ELT (op, i);

      switch (GET_CODE (elt))
      {
        case CONST_INT:
          if (INTVAL (elt) != 0)
            allzero = 0;
          break;
        case CONST_DOUBLE:
          if (CONST_DOUBLE_LOW (elt) != 0 || CONST_DOUBLE_HIGH (elt) != 0)
            allzero = 0;
          break;
        default:
          break;
      }
    }

    if (allzero)
    {
      printf ("Not CONST0_RTX but all zero, aborting!\n");
      abort ();
    }
  } else
  {
    return op == CONST0_RTX (mode);
  }
}

Then we have a case of bad luck here because it doesn't trigger.
Interestingly I can avoid this error by simply not defining constant
zero vectors in function bodies but globally instead.
 
-- 
Servus,
       Daniel


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]