On 8 Apr 2014 at 10:52, Reid Kleckner wrote:
> > > + unsigned long __edx;
> > > + unsigned long __eax;
> > > + __asm__ ("rdmsr"
> > > + : "=d"(__edx), "=a"(__eax)
> > > + : "c"(__register)
> > > + : "%ecx", "%edx", "%eax");
> > > + return (((unsigned __int64)__edx) << 32) | (unsigned __int64)__eax;
> > > +}
> >
> > i don't think this is correct, input/output registers should not appear on
> > the clobbered list. gcc itself doesn't accept this code and complains with:
> >
> > error: 'asm' operand has impossible constraints
>
>
> Yeah, that's wrong. I'll fix it. I suspected it was wrong, but it compiled
> fine.
perhaps clang should also detect and refuse such constructs in the future ;).
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits