How to mark a builtin function volatile?

Andrew Pinski pinskia@physics.uc.edu
Fri Jul 18 22:31:00 GMT 2003


> I think the problem is gcc thinks __getReg (_IA64_REG_AR_ITC) will
> never change. How can I mark a builtin function volatile?

Look at how the rs6000 backend implements __builtin_altivec_mtvscr 
basically you mark the unspec volatile:

(define_insn "altivec_mtvscr"
   [(set (reg:SI 110)
         (unspec_volatile:SI
          [(match_operand:V4SI 0 "register_operand" "v")] 186))]
   "TARGET_ALTIVEC"
   "mtvscr %0"
   [(set_attr "type" "vecsimple")])


Thanks,
Andrew Pinski



More information about the Gcc mailing list