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

Support -Cforce-frame-pointers=non-leaf #124733

Merged
merged 8 commits into from
Jun 23, 2024

Conversation

workingjubilee
Copy link
Member

Why don't we already support this...?

Suggested impl for rust-lang/compiler-team#744

@rustbot
Copy link
Collaborator

rustbot commented May 5, 2024

r? @TaKO8Ki

rustbot has assigned @TaKO8Ki.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 5, 2024
@rustbot
Copy link
Collaborator

rustbot commented May 5, 2024

Some changes occurred in compiler/rustc_codegen_cranelift

cc @bjorn3

These commits modify compiler targets.
(See the Target Tier Policy.)

@workingjubilee workingjubilee added the S-waiting-on-MCP Status: PR has a compiler MCP and is waiting for the compiler MCP to complete. label May 5, 2024
@@ -2468,6 +2468,15 @@ pub fn build_session_options(early_dcx: &mut EarlyDiagCtxt, matches: &getopts::M
}
}

if !nightly_options::is_unstable_enabled(matches)
Copy link
Contributor

Choose a reason for hiding this comment

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

Annoyingly, there seem to be multiple different ways of checking for -Zunstable-options when implementing these ad-hoc value checks:

  • Some code uses nightly_options::is_unstable_enabled(matches), which parses the value independently
  • Some code uses unstable_opts.unstable_options, which uses whatever has already been parsed into the UnstableOptions struct via normal means

In this context, we should be able to just check unstable_opts.unstable_options, which seems like the less hacky variant.

(I assume you probably just copied this from the code immediately below. 🤷)

Copy link
Member Author

Choose a reason for hiding this comment

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

I did check the unstable_options.unstable_options thing, but it says you shouldn't touch it directly, so I avoided poking it directly. idk lol?

I think there should be a different way of specifying "these values are unstable" that uses a pattern or pattern-guard of some kind.

Copy link
Member Author

Choose a reason for hiding this comment

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

I realize there's only a few cases of this so it seems like a waste, but I think a profusion of flags is partly the fault of it not being easy to add such patterns that determine stability.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don’t want to derail this PR too much, but if I get a chance I’ll open a separate issue or thread to discuss improvements to unstable values of stable flags, because the status quo has been annoying me too.

Comment on lines 2474 to 2533
early_dcx.early_fatal(
"`-Cforce-frame-pointers=non-leaf` also requires `-Zunstable-options` \
and a nightly compiler",
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we really need this? What's the concern? It's already de-facto enabled via --target=spec.json.

Copy link
Member Author

Choose a reason for hiding this comment

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

Target specs are also unstable.

Copy link
Member Author

Choose a reason for hiding this comment

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

Mind, we could land it as instantly stable, I agree it has strong precedent, but then it needs to wait on a full T-compiler FCP, so "this can happen right now without requiring everyone to agree" was why I proposed doing things "correctly".

@workingjubilee
Copy link
Member Author

workingjubilee commented May 14, 2024

#125127 was opened which suggests "always" and "never" as other options. I think adding "always" to this is fine if there's no objection from the reviewer but I don't believe we need more options for saying "no" because "never" is even more confusing than "no" or "off" (because it is strong enough it might come off as "force frame pointers to NEVER HAPPEN!!!" which is not at all what will occur).

@rust-log-analyzer

This comment has been minimized.

@workingjubilee workingjubilee force-pushed the cant-beleaf-we-dont-have-this branch 2 times, most recently from bbd9930 to f705368 Compare May 14, 2024 19:59
@workingjubilee workingjubilee removed the S-waiting-on-MCP Status: PR has a compiler MCP and is waiting for the compiler MCP to complete. label May 26, 2024
@workingjubilee
Copy link
Member Author

rust-lang/compiler-team#744 was accepted.

@workingjubilee
Copy link
Member Author

r? T-compiler

@rustbot rustbot assigned compiler-errors and unassigned TaKO8Ki Jun 11, 2024
@compiler-errors
Copy link
Member

I have no context about this, sorry

r? compiler

@rustbot rustbot assigned TaKO8Ki and unassigned compiler-errors Jun 18, 2024
@workingjubilee
Copy link
Member Author

r? compiler

@rustbot rustbot assigned estebank and unassigned TaKO8Ki Jun 22, 2024
@saethlin
Copy link
Member

r? saethlin
@bors r+

Requires -Zunstable-options as this is a -C flag already.
Also lands behind -Zunstable-options, for now.
Take the opportunity to do some mild cleanup.
all of these currently force stronger frame pointers, and
currently the CLI does not override the target
@workingjubilee
Copy link
Member Author

there... should have rebased so that the build worked again locally to start...

@workingjubilee
Copy link
Member Author

@bors r=saethlin

@bors
Copy link
Contributor

bors commented Jun 23, 2024

📌 Commit c72a6ad has been approved by saethlin

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 23, 2024
@bors
Copy link
Contributor

bors commented Jun 23, 2024

⌛ Testing commit c72a6ad with merge 45af7d9...

bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 23, 2024
…ave-this, r=saethlin

Support `-Cforce-frame-pointers=non-leaf`

Why don't we already support this...?

Suggested impl for rust-lang/compiler-team#744
@bors
Copy link
Contributor

bors commented Jun 23, 2024

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 23, 2024
@workingjubilee
Copy link
Member Author

fuchsia...

@bors r=saethlin

@bors
Copy link
Contributor

bors commented Jun 23, 2024

📌 Commit 761ba5b has been approved by saethlin

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 23, 2024
@bors
Copy link
Contributor

bors commented Jun 23, 2024

⌛ Testing commit 761ba5b with merge c3d7fb3...

@bors
Copy link
Contributor

bors commented Jun 23, 2024

☀️ Test successful - checks-actions
Approved by: saethlin
Pushing c3d7fb3 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 23, 2024
@bors bors merged commit c3d7fb3 into rust-lang:master Jun 23, 2024
7 checks passed
@rustbot rustbot added this to the 1.81.0 milestone Jun 23, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (c3d7fb3): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

Results (secondary 2.3%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.3% [2.1%, 2.6%] 7
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

Results (secondary 0.0%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.0% [0.0%, 0.0%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Bootstrap: 691.495s -> 693.516s (0.29%)
Artifact size: 326.88 MiB -> 326.77 MiB (-0.04%)

@workingjubilee workingjubilee deleted the cant-beleaf-we-dont-have-this branch June 23, 2024 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.