Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

[x86/Linux] Fix error variable 'td' is uninitialized #8299

Merged
merged 1 commit into from
Nov 28, 2016
Merged

[x86/Linux] Fix error variable 'td' is uninitialized #8299

merged 1 commit into from
Nov 28, 2016

Conversation

seanshpark
Copy link

@seanshpark seanshpark commented Nov 24, 2016

Fix compile error for x86/Linux

  • make compiler happy with initialize variable 'td' with 0.0

long double td;
#else
double td = 0.0;
#endif
__asm fstp td // copy out the double
Copy link
Member

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.

Copy link
Author

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.

Copy link
Member

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.

Copy link
Author

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.

Copy link
Author

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
@seanshpark
Copy link
Author

@janvorli , @jkotas , @gkhanna79 , PTAL

@seanshpark
Copy link
Author

@jkotas, could you please look this again?

@jkotas
Copy link
Member

jkotas commented Nov 28, 2016

LGTM

@jkotas jkotas merged commit e5d9c9f into dotnet:master Nov 28, 2016
@seanshpark seanshpark deleted the x86dbg01 branch November 28, 2016 22:53
@karelz karelz modified the milestone: 2.0.0 Aug 28, 2017
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
…8299)

Fix compile error for x86/Linux
- make compiler happy with initialize variable 'td' with 0.0

Commit migrated from dotnet/coreclr@e5d9c9f
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants