dotnet / runtimelab

This repo is for experimentation and exploring new ideas that may or may not make it into the main dotnet/runtime repo.
MIT License
1.38k stars 192 forks source link

[NativeAOT-LLVM] Fix a corner-case bug with explicit tail calls #2458

Closed SingleAccretion closed 8 months ago

SingleAccretion commented 8 months ago

Explicit (.tail) void-returning tailcalls suppress the importation of GT_RETURN. Compensate for this IR quirk in lowering.

.tail is used in the MainMethodWrapper to compensate for NoOptimization, where this bug was hit by @maraf. We haven't hit it before because all the runtime tests use error codes to communicate success/failure, hence all the main methods are int-returning.

Adapted the C++ EH test, which doesn't return normally from Main, to test this scenario.

SingleAccretion commented 8 months ago

@dotnet/nativeaot-llvm