runtime icon indicating copy to clipboard operation
runtime copied to clipboard

[x86/ARM32/RuyJit] Zero relocation

Open BredPet opened this issue 8 years ago • 6 comments

I try to compile with ILC compiler some ARM sample by x86 environment with armelnonjit. There is a problem with recordRelocation. Here imm comes with zero value from genSetRegToConst. It calls: instGen_Set_Reg_To_Imm(EA_HANDLE_CNS_RELOC, targetReg, cnsVal) with zero cnsVal. I'm trying to figure it out okay or not? Why is there 0 value and the relocation flag is set? Can I just protect and do not create relocation if there's zero? Or maybe it reports on some more significant problem somewhere else.

@dotnet/arm32-contrib

BredPet avatar Mar 21 '18 07:03 BredPet

What is the C#/IL code that causes us to hit this path?

This can be a problem on CoreCLR as well.

jkotas avatar Mar 21 '18 14:03 jkotas

@jkotas

using System;
namespace Hello
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            if (args.Length == 0)
            {
                Console.WriteLine("Usage: hello name");
                return;
            }
            Console.WriteLine("Hello " + args[0]);
        }
    }
}

Maybe it's important, this only happens when the compilation is in release mode(ilc release build, CoreCLR release), debug compilation ends successfully.

BredPet avatar Mar 21 '18 15:03 BredPet

This is probably hit by one of the framework methods. Could you please find out the exact method name that hits this?

jkotas avatar Mar 21 '18 16:03 jkotas

https://github.com/dotnet/coreclr/issues/17109 looks like exactly same problem.

jkotas avatar Mar 22 '18 04:03 jkotas

[S.P.CompilerGenerated]Internal.CompilerGenerated.<Module>.InvokeRetO<int64>(object,native int,ArgSetupState&,bool)

BredPet avatar Mar 22 '18 07:03 BredPet

Assuming Duplicate of dotnet/coreclr#17109.

RussKeldorph avatar Mar 22 '18 17:03 RussKeldorph