-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[x86/Linux] Fix error variable 'td' is uninitialized #8299
Conversation
long double td; | ||
#else | ||
double td = 0.0; | ||
#endif | ||
__asm fstp td // copy out the double |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this inline assembly compile on Unix? I would expect that this whole block will need #ifdef _MSCVER
to differentiate between Windows-style inline assembly and Unix-style inline assembly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to compile with clang3.8, which I'm using.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can just initialize it unconditionally to 0, even on Windows - no need for ifdef.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
simple test code doesn't seem to compile. I need to check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for information, clang simple test code with -fasm-blocks
passes compilation.
Fix compile error for x86/Linux - make compiler happy with initialize variable 'td' with 0.0
@janvorli , @jkotas , @gkhanna79 , PTAL |
@jkotas, could you please look this again? |
LGTM |
…8299) Fix compile error for x86/Linux - make compiler happy with initialize variable 'td' with 0.0 Commit migrated from dotnet/coreclr@e5d9c9f
Fix compile error for x86/Linux