Skip to content
This repository was archived by the owner on Nov 1, 2020. It is now read-only.
This repository was archived by the owner on Nov 1, 2020. It is now read-only.

Assertion failed in fgMorphCall #2073

@MichalStrehovsky

Description

@MichalStrehovsky

In CoreCLR, canTailCall is hardcoded to return false in Ready To Run compilation - we never attempt to do tail calls. The CoreRT compiler doesn't put such restrictions and we're hitting the following assert when compiling Hello world with CHK RyuJIT (the combination of R2R and tail calls allowed triggers this):

#ifdef DEBUG
        // Tail call needs to be in one of the following IR forms
        //    Either a call stmt or
        //    GT_RETURN(GT_CALL(..)) or
        //    var = call
        noway_assert((stmtExpr->gtOper == GT_CALL && stmtExpr == call) ||
                     (stmtExpr->gtOper == GT_RETURN &&
                      (stmtExpr->gtOp.gtOp1 == call || stmtExpr->gtOp.gtOp1->gtOp.gtOp1 == call)) ||
                     (stmtExpr->gtOper == GT_ASG && stmtExpr->gtOp.gtOp2 == call));
#endif

To repro, undo the workaround from #2074.

@jkotas scoped the problem down to an issue around FEATURE_TAILCALL_OPT_SHARED_RETURN

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions