Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authort-mustafin <66252296+t-mustafin@users.noreply.github.com>2021-07-09 23:26:10 +0300
committerGitHub <noreply@github.com>2021-07-09 23:26:10 +0300
commit39d1161c88976dacf8774aa97b5f1a2749fed21d (patch)
treef50a0bf9c5b5637cdcf4cbb70ac2c55085706103 /src/coreclr/jit
parentc8486b69ceda1b09cf06659869eb0114936619b6 (diff)
Fix helloworld on x86 Linux (#55095)
Make managed->managed call use of ecx, edx to pass first two arguments. Make stack alignment returning after call.
Diffstat (limited to 'src/coreclr/jit')
-rw-r--r--src/coreclr/jit/gentree.cpp3
-rw-r--r--src/coreclr/jit/morph.cpp9
2 files changed, 10 insertions, 2 deletions
diff --git a/src/coreclr/jit/gentree.cpp b/src/coreclr/jit/gentree.cpp
index b56372d18d2..9422225c5d3 100644
--- a/src/coreclr/jit/gentree.cpp
+++ b/src/coreclr/jit/gentree.cpp
@@ -6423,6 +6423,9 @@ GenTreeCall* Compiler::gtNewCallNode(
GenTreeCall* node = new (this, GT_CALL) GenTreeCall(genActualType(type));
node->gtFlags |= (GTF_CALL | GTF_GLOB_REF);
+#ifdef UNIX_X86_ABI
+ node->gtFlags |= GTF_CALL_POP_ARGS;
+#endif // UNIX_X86_ABI
for (GenTreeCall::Use& use : GenTreeCall::UseList(args))
{
node->gtFlags |= (use.GetNode()->gtFlags & GTF_ALL_EFFECT);
diff --git a/src/coreclr/jit/morph.cpp b/src/coreclr/jit/morph.cpp
index 9f734adaa71..daca2c487e2 100644
--- a/src/coreclr/jit/morph.cpp
+++ b/src/coreclr/jit/morph.cpp
@@ -74,6 +74,9 @@ GenTree* Compiler::fgMorphIntoHelperCall(GenTree* tree, int helper, GenTreeCall:
call->gtCallMoreFlags = GTF_CALL_M_EMPTY;
call->gtInlineCandidateInfo = nullptr;
call->gtControlExpr = nullptr;
+#ifdef UNIX_X86_ABI
+ call->gtFlags |= GTF_CALL_POP_ARGS;
+#endif // UNIX_X86_ABI
#if DEBUG
// Helper calls are never candidates.
@@ -2894,9 +2897,10 @@ void Compiler::fgInitArgInfo(GenTreeCall* call)
}
#ifdef TARGET_X86
- // Compute the maximum number of arguments that can be passed in registers.
- // For X86 we handle the varargs and unmanaged calling conventions
+// Compute the maximum number of arguments that can be passed in registers.
+// For X86 we handle the varargs and unmanaged calling conventions
+#ifndef UNIX_X86_ABI
if (call->gtFlags & GTF_CALL_POP_ARGS)
{
noway_assert(intArgRegNum < MAX_REG_ARG);
@@ -2907,6 +2911,7 @@ void Compiler::fgInitArgInfo(GenTreeCall* call)
if (callHasRetBuffArg)
maxRegArgs++;
}
+#endif // UNIX_X86_ABI
if (call->IsUnmanaged())
{