-
-
Notifications
You must be signed in to change notification settings - Fork 16.6k
Why is the code size of catch_unwind so large ? #64224
Copy link
Copy link
Closed
Labels
C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.I-heavyIssue: Problems and improvements with respect to binary size of generated code.Issue: Problems and improvements with respect to binary size of generated code.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-libs-api[DEPRECATED; DO NOT USE][DEPRECATED; DO NOT USE]
Description
Activity
Metadata
Metadata
Assignees
Labels
C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.I-heavyIssue: Problems and improvements with respect to binary size of generated code.Issue: Problems and improvements with respect to binary size of generated code.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-libs-api[DEPRECATED; DO NOT USE][DEPRECATED; DO NOT USE]
While filling #64222 I noticed that we generate more code than C++ for
catch_unwind. That did not feel right, since C++'scatchcan do much more than Rust's catch unwind, e.g., filtering different types of exceptions, etc.MWE: C++ (https://gcc.godbolt.org/z/z_dgPg):
generates
while Rust (https://gcc.godbolt.org/z/4sbc6k):
generates
This appears to be a constant overhead every time
catch_unwindis used (e.g. see https://gcc.godbolt.org/z/bAvN24). Maybe we are inlining too much ?