Menu

#4 prog/apps/timing/main.h crashes on Mac OS X

open
nobody
None
5
2004-08-18
2004-08-18
No

The file prog/apps/timing/main.h contains the following code
fragment:

#ifdef WIN32
static inline
int64 GetTimeTSC() {
__asm _emit 0x0f __asm _emit 0x31
}
#else
static inline
int64 GetTimeTSC() {
int64 t;
__asm__ __volatile__("rdtsc" : "=A" (t));
return t;
}
#endif

The asm directive in the not WIN32 example is x86 assembly;
when compiled on a non-x86 platform, the code fails to compile.
On Apple's gcc-3.3 (build 1640), it causes the compiler to crash.
Apple recently received a bug report from an outside developer
who wanted to use brook, but couldn't get it to build because of
this crash. If this function is commented out, the rest of brook
compiles fine. Some
of the examples work.

We've opened a bug at Apple to fix gcc-3.3 crashing when
encountering illegal assembly directives. However, to enable Mac
owners to experiment with Brook, could someone change this code
to check the target processor and not use x86 assembly directives
on non-x86 targets?

Discussion


Log in to post a comment.