I am working on a port with gcc-4.0.2, and I've been getting a segmentation fault when call_used_regs[] is referenced with a pseudo register in fixup_match_2() in regmove.c.

   if (call_used_regs[REGNO(dst)])
       || find_reg_fusage (p, CLOBBER, dst))
      break;
   ...........
}

regmove_optimize() calls fixup_match_2(), and checks that REGNO(dst) is a pseudo register, or it will skip the piece of code that calls fixup_match_2().

         if (!REG_P (dst)
         || REGNO (dst) < FIRST_PSEUDO_REGISTER
         || REG_LIVE_LENGTH (REGNO (dst)) < 0
         || GET_MODE (src) != GET_MODE (dst))
       continue;
        .................
         if (REGNO (src) < FIRST_PSEUDO_REGISTER)
       {
         if (GET_CODE (SET_SRC (set)) == PLUS
             && GET_CODE (XEXP (SET_SRC (set), 1)) == CONST_INT
             && XEXP (SET_SRC (set), 0) == src
             && fixup_match_2 (insn, dst, src,
                   XEXP (SET_SRC (set), 1),
                   regmove_dump_file))
           break;

Is there another area within regmove_optimize() that constrains the dst to be a real register? That would prevent the segmentation fault when call_used_regs[] is accessed with a pseudo register.

Thanks for your help.

Jeffri

<http://www.google.com/url?sa=D&q=http%3A%2F%2Fwww.autospies.com%2Farticle%2Findex.asp%3FarticleId%3D6654%26categoryId%3D>

Reply via email to