Skip to content

JIT: Wrong result forwarding argument for tailcall on linux-x64 #116466

@jakobbotsch

Description

@jakobbotsch
// Generated by Fuzzlyn v3.2 on 2025-06-08 15:45:13
// Run on X64 Linux
// Seed: 5301785820831683815-vectort,vector128,vector256,x86aes,x86avx,x86avx2,x86avx512bw,x86avx512bwvl,x86avx512cd,x86avx512cdvl,x86avx512dq,x86avx512dqvl,x86avx512f,x86avx512fvl,x86avx512fx64,x86bmi1,x86bmi1x64,x86bmi2,x86bmi2x64,x86fma,x86lzcnt,x86lzcntx64,x86pclmulqdq,x86popcnt,x86popcntx64,x86sse,x86ssex64,x86sse2,x86sse2x64,x86sse3,x86sse41,x86sse41x64,x86sse42,x86sse42x64,x86ssse3,x86x86base
// Reduced from 219.4 KiB to 1.8 KiB in 00:06:09
// Debug: Outputs 1
// Release: Outputs 0
using System;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;

public struct S0
{
    public short F3;
    public Vector<ushort> F6;
    public short F7;
    public S0(short f7) : this()
    {
        F7 = f7;
    }
}

public struct S1
{
    public S0 F0;
}

public class Program
{
    public static IRuntime s_rt;
    public static Vector256<uint> s_19;
    public static sbyte s_25;
    public static void Main()
    {
        CollectibleALC alc = new CollectibleALC();
        System.Reflection.Assembly asm = alc.LoadFromAssemblyPath(System.Reflection.Assembly.GetExecutingAssembly().Location);
        System.Reflection.MethodInfo mi = asm.GetType(typeof(Program).FullName).GetMethod(nameof(MainInner));
        System.Type runtimeTy = asm.GetType(typeof(Runtime).FullName);
        mi.Invoke(null, new object[] { System.Activator.CreateInstance(runtimeTy) });
    }

    public static void MainInner(IRuntime rt)
    {
        s_rt = rt;
        var vr3 = new S0(1);
        var vr4 = new S1();
        M11(vr3, vr4);
    }

    public static short M11(S0 arg0, S1 arg7)
    {
        s_19 = s_19;
        var vr2 = Vector128.CreateScalar(0UL).AsVector();
        return M12(vr2, s_25, arg0);
    }

    public static short M12(Vector<ulong> arg0, sbyte arg2, S0 arg3)
    {
        short var1 = arg3.F7;
        s_rt.WriteLine("c_479", var1);
        return arg3.F3;
    }
}

public interface IRuntime
{
    void WriteLine<T>(string site, T value);
}

public class Runtime : IRuntime
{
    public void WriteLine<T>(string site, T value) => System.Console.WriteLine(value);
}

public class CollectibleALC : System.Runtime.Loader.AssemblyLoadContext
{
    public CollectibleALC() : base(true)
    {
    }
}

Likely related to #115977

Metadata

Metadata

Assignees

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions