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

Sync rustc_codegen_gcc #95338

Merged
merged 92 commits into from
Mar 27, 2022
Merged

Sync rustc_codegen_gcc #95338

merged 92 commits into from
Mar 27, 2022

Conversation

bjorn3
Copy link
Member

@bjorn3 bjorn3 commented Mar 26, 2022

r? @ghost

@rustbot label +A-codegen +A-gcc +T-compiler

cc @antoyo

erikdesjardins and others added 30 commits December 29, 2021 15:47
Now that deferred inlining has been disabled in LLVM,
this shouldn't cause catastrophic size blowup.
Mark drop calls in landing pads `cold` instead of `noinline`

Now that deferred inlining has been disabled in LLVM (rust-lang#92110), this shouldn't cause catastrophic size blowup.

I confirmed that the test cases from rust-lang#41696 (comment) still compile quickly (<1s) after this change. ~Although note that I wasn't able to reproduce the original issue using a recent rustc/llvm with deferred inlining enabled, so those tests may no longer be representative. I was also unable to create a modified test case that reproduced the original issue.~ (edit: I reproduced it on CI by accident--the first commit timed out on the LLVM 12 builder, because I forgot to make it conditional on LLVM version)

r? `@nagisa`
cc `@arielb1` (this effectively reverts rust-lang#42771 "mark calls in the unwind path as !noinline")
cc `@RalfJung` (fixes rust-lang#46515)

edit: also fixes rust-lang#87055
Replace `-Z symbol-mangling-version=v0` with `-C symbol-mangling-version=v0`.

Replace `-Z symbol-mangling-version=legacy` with
`-Z unstable-options -C symbol-mangling-version=legacy`.
The field is also renamed from `ident` to `name. In most cases,
we don't actually need the `Span`. A new `ident` method is added
to `VariantDef` and `FieldDef`, which constructs the full `Ident`
using `tcx.def_ident_span()`. This method is used in the cases
where we actually need an `Ident`.

This makes incremental compilation properly track changes
to the `Span`, without all of the invalidations caused by storing
a `Span` directly via an `Ident`.
This saves a couple of Symbol::intern calls
Given that these instructions are diverging, not every codegen backend
may be able to produce a return value for them.
Some codegen backends may require all handlers to be immediately known
Previously foreign statics would actually cause a local static to be
defined and exported. This issue was found because std::env::vars() was
found to return no env vars despite many being defined. This was caused
by libstd importing environ as foreign static. The accidental definition
of environ caused libstd to read a null pointer which was interpreted as
there being no environment variables at all.

Also fix tests. STDOUT is not defined by libc. The correct name is stdout.
This previously worked as STDOUT was incorrectly defined as null pointer
during codegen.
This allows cargo check to function correctly without having to first
run prepare_build.sh. cg_clif has been using rust-toolchain too for a
while now.
* Renable failing test
* Update to newest gccjit.rs
This puts every function and data object in their own section. This
allows the linker to omit unused functions and data objects with
--gc-sections.

On linux this shrinks a hello world binary without optimizations
(neither sysroot nor binary) from 17MB to 13MB. It shrinks a hello world
binary with only sysroot optimizations from 14MB to 13MB. For comparison
cg_llvm produces a 3.5MB debug mode hello world binary with an optimized
sysroot. Cg_clif produces a 10MB debug mode hello world binary without
an optimized sysroot.
…ng#103)

* Use sized integer types

* Add support for integer types not supported on some platforms

* Add feature to test non-native integers in CI
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Mar 26, 2022
@bors
Copy link
Contributor

bors commented Mar 26, 2022

⌛ Testing commit bbff48e with merge f4f4793746b4431cd103189a69d0be49d72f83fc...

@bors
Copy link
Contributor

bors commented Mar 26, 2022

💔 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 Mar 26, 2022
@bjorn3
Copy link
Member Author

bjorn3 commented Mar 26, 2022

cc @rust-lang/crates-io I think crates.io is having some issues with giving spurious 403 errors.

@Dylan-DPC
Copy link
Member

@bors retry

@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 Mar 26, 2022
@rust-log-analyzer
Copy link
Collaborator

The job wasm32 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@rust-log-analyzer
Copy link
Collaborator

The job armhf-gnu failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@Dylan-DPC
Copy link
Member

@bors treeclosed--

@Dylan-DPC
Copy link
Member

@bors retry

@Dylan-DPC
Copy link
Member

@bors treeclosed-

Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Mar 26, 2022
…toyo

Sync rustc_codegen_gcc

r? `@ghost`

`@rustbot` label +A-codegen +A-gcc +T-compiler

cc `@antoyo`
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Mar 26, 2022
…toyo

Sync rustc_codegen_gcc

r? ``@ghost``

``@rustbot`` label +A-codegen +A-gcc +T-compiler

cc ``@antoyo``
@bors
Copy link
Contributor

bors commented Mar 27, 2022

⌛ Testing commit bbff48e with merge 06c3c62...

@bors
Copy link
Contributor

bors commented Mar 27, 2022

☀️ Test successful - checks-actions
Approved by: antoyo
Pushing 06c3c62 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Mar 27, 2022
@bors bors merged commit 06c3c62 into rust-lang:master Mar 27, 2022
@rustbot rustbot added this to the 1.61.0 milestone Mar 27, 2022
@bjorn3 bjorn3 deleted the sync_cg_gcc-2022-03-26 branch March 27, 2022 10:34
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (06c3c62): comparison url.

Summary: This benchmark run did not return any relevant results.

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation A-gcc Things relevant to the [future] GCC backend 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-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.