This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
How to mark a builtin function volatile?
- From: "H. J. Lu" <hjl at lucon dot org>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 18 Jul 2003 14:45:29 -0700
- Subject: 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.