------- Comment #14 from jakub at gcc dot gnu dot org  2007-09-26 21:19 -------
This isn't related to commutative constraints, can be reproduced with:
void
mul_basecase (unsigned long *wp, unsigned long *up, long un,
              unsigned long *vp, long vn)
{
  long j;
  unsigned long prod_low, prod_high;
  unsigned long cy_dig;
  unsigned long v_limb;
  v_limb = vp[0];
  cy_dig = 0;
  for (j = un; j > 0; j--)
    {
      unsigned long u_limb, w_limb;
      u_limb = *up++;
      __asm__ ("mulq %3"
               : "=a" (prod_low), "=d" (prod_high)
               : "0" (u_limb), "rm" (v_limb));
      __asm__ ("addq %5,%q1\n\tadcq %3,%q0"
               : "=r" (cy_dig), "=&r" (w_limb)
               : "0" (prod_high), "rme" (0), "1" (prod_low), "rme" (cy_dig));
      *wp++ = w_limb;
    }
}

The problem is that match_asm_constraints_1 doesn't do any checking whether
the change it wants to do is actually valid.
Particularly it must and does not check whether the output (whose value it will
kill in the new insn prepended before the asm) isn't among inputs of the asm.
Also, I wonder whether it shouldn't limit any changes to REGs, ATM it will
happily copy around MEMs etc., which IMHO is highly undesirable.
When the output is present among inputs (except for the one with matching
constraint), we have either a choice to create a new pseudo or just don't do
anything.


-- 


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

Reply via email to