Skip to content

Support guaranteed tail calls#911

Merged
antoyo merged 1 commit into
rust-lang:masterfrom
folkertdev:guaranteed-tail-calls
Jul 16, 2026
Merged

Support guaranteed tail calls#911
antoyo merged 1 commit into
rust-lang:masterfrom
folkertdev:guaranteed-tail-calls

Conversation

@folkertdev

Copy link
Copy Markdown
Contributor

Add support for become using GCC's musttail implementation. Depends on

Comment thread src/builder.rs
} else {
#[cfg(not(feature = "master"))]
if gcc_func.get_param_count() == 0 {
// FIXME(antoyo): As a temporary workaround for unsupported LLVM intrinsics.

@folkertdev folkertdev Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this workaround still needed? I think this code can be refactored a bunch (sharing this assignment logic between direct and pointer calls) if it is now redundant.

View changes since the review

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can try removing this code, but I believe this refers to some intrinsics that we translate to __builtin_trap because it's not yet supported, so this is likely still needed.
A refactor could possibly allow us to remove this hack, though.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well if you're ok with the changes then you can merge this. I made a separate PR to check if CI fails with that hack removed

@folkertdev
folkertdev force-pushed the guaranteed-tail-calls branch from 9bce153 to 6b91439 Compare July 16, 2026 20:33
@folkertdev
folkertdev force-pushed the guaranteed-tail-calls branch from 6b91439 to 61a02cd Compare July 16, 2026 20:34
@folkertdev
folkertdev marked this pull request as ready for review July 16, 2026 20:35
Comment thread tests/failing-ui-tests.txt
@antoyo
antoyo merged commit 5b4dbca into rust-lang:master Jul 16, 2026
40 checks passed
@antoyo

antoyo commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants