------- Additional Comments From amylaar at gcc dot gnu dot org  2005-05-31 
20:56 -------
The problem would not arise if the call was neither const nor pure.

cselib_process_insn has this code:

  if (CALL_P (insn))
    {
      for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
        if (call_used_regs[i]
            || (REG_VALUES (i) && REG_VALUES (i)->elt
                && HARD_REGNO_CALL_PART_CLOBBERED (i,
                      GET_MODE (REG_VALUES (i)->elt->u.val_rtx))))
          cselib_invalidate_regno (i, reg_raw_mode[i]);

      if (! CONST_OR_PURE_CALL_P (insn))
        cselib_invalidate_mem (callmem);
    }

So, this explains why ordinary calls work.

There is code in load_mems to take the argument of calls into account, but
it requires CALL_INSN_FUNCTION_USAGE to be set.  So a possible fix would make
sure that CALL_INSN_FUNCTION_USAGE is set correctly, at least for
CONST_OR_PURE_CALL_P functions.

-- 


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

Reply via email to