Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JIT] X64/ARM64 - Incorrect optimization prints 35514 instead of 28876 #85382

Closed
TIHan opened this issue Apr 26, 2023 · 3 comments
Closed

[JIT] X64/ARM64 - Incorrect optimization prints 35514 instead of 28876 #85382

TIHan opened this issue Apr 26, 2023 · 3 comments
Assignees
Labels
arch-arm64 arch-x64 area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI bug os-linux Linux OS (any supported distro) os-mac-os-x macOS aka OSX os-windows
Milestone

Comments

@TIHan
Copy link
Contributor

TIHan commented Apr 26, 2023

// Generated by Fuzzlyn v1.5 on 2023-04-26 02:07:41
// Run on Arm64 MacOS
// Seed: 4341704563799292540
// Reduced from 104.8 KiB to 0.5 KiB in 00:00:34
// Debug: Outputs 28876
// Release: Outputs 35514
public class Program
{
    public static long s_15;
    public static sbyte s_17;
    public static ushort s_21 = 36659;
    public static void Main()
    {
        s_15 = ~1;
        bool vr1 = M40(0);
    }

    public static bool M40(ushort arg0)
    {
        for (int var0 = 0; var0 < 2; var0++)
        {
            arg0 = 65535;
            arg0 &= (ushort)(s_15++ >> s_17);
            arg0 %= s_21;
        }

        System.Console.WriteLine(arg0);
        return false;
    }
}

Reproduces on Windows ARM64 and X64.

@TIHan TIHan added bug arch-arm64 os-linux Linux OS (any supported distro) os-mac-os-x macOS aka OSX os-windows area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI labels Apr 26, 2023
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Apr 26, 2023
@ghost
Copy link

ghost commented Apr 26, 2023

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

Issue Details
// Generated by Fuzzlyn v1.5 on 2023-04-26 02:07:41
// Run on Arm64 MacOS
// Seed: 4341704563799292540
// Reduced from 104.8 KiB to 0.5 KiB in 00:00:34
// Debug: Outputs 28876
// Release: Outputs 35514
public class Program
{
    public static long s_15;
    public static sbyte s_17;
    public static ushort s_21 = 36659;
    public static void Main()
    {
        s_15 = ~1;
        bool vr1 = M40(0);
    }

    public static bool M40(ushort arg0)
    {
        for (int var0 = 0; var0 < 2; var0++)
        {
            arg0 = 65535;
            arg0 &= (ushort)(s_15++ >> s_17);
            arg0 %= s_21;
        }

        System.Console.WriteLine(arg0);
        return false;
    }
}

Reproduces on Windows ARM64.

Author: TIHan
Assignees: -
Labels:

bug, arch-arm64, os-linux, os-mac-os-x, os-windows, area-CodeGen-coreclr

Milestone: -

@JulieLeeMSFT JulieLeeMSFT removed the untriaged New issue has not been triaged by the area owner label Apr 26, 2023
@JulieLeeMSFT JulieLeeMSFT added this to the 8.0.0 milestone Apr 26, 2023
@TIHan
Copy link
Contributor Author

TIHan commented May 2, 2023

#85081 is related.

@TIHan TIHan added the arch-x64 label May 3, 2023
@TIHan
Copy link
Contributor Author

TIHan commented May 3, 2023

This is another issue related to optimizing CAST nodes by removal for NormalizeOnLoad assignments.

@TIHan TIHan changed the title [JIT] ARM64 - Incorrect optimization prints 35514 instead of 28876 [JIT] X64/ARM64 - Incorrect optimization prints 35514 instead of 28876 May 3, 2023
@TIHan TIHan closed this as completed Jul 20, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Aug 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-arm64 arch-x64 area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI bug os-linux Linux OS (any supported distro) os-mac-os-x macOS aka OSX os-windows
Projects
None yet
Development

No branches or pull requests

2 participants