This is the mail archive of the gcc-bugs@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]

[Bug target/26655] ICE in ix86_secondary_memory_needed, at config/i386/i386.c:16446



------- Comment #4 from pinskia at gcc dot gnu dot org  2006-03-12 18:58 -------
This is invalid inline-asm:
static inline uint64_t read_time(void)
{
 uint64_t a, d;
 asm volatile( "rdtsc\n\t"
  : "=a" (a), "=d" (d)
 );
 return (d << 32) | (a & 0xffffffff);
}

-----
The correct way to implement this inline is:
static inline uint64_t read_time(void)
{
 uint32_t a, d;
 asm volatile( "rdtsc\n\t"
  : "=a" (a), "=d" (d)
 );
 return (((uint64_t)d) << 32) | (((uint64_t)a) & 0xffffffff);
}
After that it works :).


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|critical                    |minor
           Keywords|                            |error-recovery, ice-on-
                   |                            |invalid-code


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


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