>> There is a lovely potential register mismatch issue, which can be
>> reproduced easily with the following setup
>>
>> using gcc 3.3.3 (SuSe linux)
>> When compiled with gcc –O0 to gcc –O2, register eax is used
>> When compiled with gcc –O3 and higher, register edx is used
>>
>> asm volatile("rdtsc":"=A" (tsc));
>> //<--- BUG HERE
>
> http://gcc.gnu.org/onlinedocs/gcc/Machine-Constraints.html#Machine-Constraints
>
> "A" - The a and d registers, as a pair (for instructions that return
> half the result in one and half in the other).
>
>
> I'm surprised by the difference -O3 makes, I'd have thought for
> something like this would not change behavior.
It shouldn't. Behaviour change with optimization level is more than
likely a compiler bug. Well, one can argue that "=A"(32-bit) is pushing
the luck with implicit type conversion, but on the other hand the
compiler should have said that it's pushing the luck (e.g. by failing to
compile with internal error), not generated invalid code.
In other words I wouldn't say it's OpenSSL bug, but compiler one. And it
*should* be reported to gcc people. Though it doesn't necessarily mean
that we will refuse to compensate for it. It happened before in
"might-be-pushing-the-luck" situations.
http://cvs.openssl.org/chngview?cn=19745. A.
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [email protected]
Automated List Manager [email protected]