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]

How to mark a builtin function volatile?


I am implementing IA64 intrinsics. One of them is

extern long long int __getReg (_IA64_REG_AR_ITC);

where _IA64_REG_AR_ITC is a constant. It will return the CPU time
counter. When I compile the code like:

  unsigned long int __itc;
  do
    __itc = __getReg (_IA64_REG_AR_ITC);
  while ((long int) __itc != -1);
 
with -O2, I got

        mov r8 = ar44
        ;;
        .mii
        cmp.ne p6, p7 = -1, r8
        nop.i 0
        nop.i 0
.L3:
        .pred.rel.mutex p6, p7
        .mib
        nop.m 0
        nop.i 0
        (p6) br.cond.dptk .L3
        .mib
 
I think the problem is gcc thinks __getReg (_IA64_REG_AR_ITC) will
never change. How can I mark a builtin function volatile?


H.J.


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