Repository navigation
Run cg_gcc tests with the correct compiler - #163533
Conversation
|
Debug assertions are expected to be disabled for cg_gcc. This is a known issue. |
|
So I should change bootstrap to compile cg_gcc without debug assertions, and that's it? |
I'm not sure if it is cg_gcc or rustc that needs to be compiled without debug assertion. [rust]
codegen-backends = ["gcc"]
deny-warnings = false
debug-assertions = false
debug-assertions-std = false
lto = "off" |
|
cg_ssa needs to be compiled without debug assertions as the debug assertion that fails is in cg_ssa. |
|
Hmm, that means that we'd have to run all cg_gcc tests without debug assertions. Well, doable, I guess, but annoying for local experiments. |
|
Hmm, I realized that we don't actually run these tests in CI, unless I missed something. We only test UI tests and library tests at the moment (which is also why we didn't catch this earlier). So I guess that we can already merge this as-is, it just won't work with debug assertions enabled. I at least added a warning. |
|
|
|
rustbot has assigned @Mark-Simulacrum. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
r? bjorn3 |
| pattern_types, | ||
| thread_local | ||
| thread_local, | ||
| rustc_private |
There was a problem hiding this comment.
You will also need to change cg_gcc's build system to pass -Zforce-unstable-if-unmarked when testing mini_core and mini_core_hello_world. Otherwise this will result in a warning in cg_gcc's CI.
There was a problem hiding this comment.
You will also need to change cg_gcc's build system to pass
-Zforce-unstable-if-unmarked
Why is that? Could we just add the missing features in the code?
There was a problem hiding this comment.
If #![feature(rustc_private)] is not used, everything works, except when -Zforce-unstable-if-unmarked is used (as it unconditionally is when testing through bootstrap). If -Zforce-unstable-if-unmarked is used, then the const stability checker will require #![feature(rustc_private)] to be set as the size_of intrinsic gets marked as unstable(rustc_private), yet it doesn't take into account that the entire crate is unstable(rustc_private) like the regular stability checker. But if -Zforce-unstable-if-unmarked is not set, then #![feature(rustc_private)] would be unused as nothing would get marked as unstable(rustc_private).
|
@rustbot ready |
|
@bors r+ |
…uwer Rollup of 9 pull requests Successful merges: - #161491 (Rip out old solver coherence) - #163533 (Run cg_gcc tests with the correct compiler) - #163223 (regression test for async handler normalization ICE) - #163367 (simplify rustc_log a bit) - #163622 (x86: c-variadic functions don't use registers with `-Zregparm`) - #163653 (callconv: mips64: Match GCC for alignment of 16-byte scalars) - #163665 (Parser: Refactor & better document `should_continue_as_assoc_expr` & `can_continue_expr_unambiguously`) - #163742 (Add the `movdir64b` and `movdiri` x86 target features) - #163752 (Revert "implement PartialEq<VecDeque<U>> for Vec<T>, &[T], &mut [T], [T; N], &[T; N] and &mut [T; N]")
Rollup merge of #163533 - Kobzol:cg-gcc-tests, r=bjorn3 Run cg_gcc tests with the correct compiler Seems like we have been running the tests with the stage 0 compiler all along :surprised: The tests crash with: ``` [BUILD] mini_core [BUILD] example [AOT] mini_core_hello_world warning: the feature `never_type` has been stable since 1.101.0-dev and no longer requires an attribute to enable --> example/mini_core_hello_world.rs:4:44 | 4 | no_core, unboxed_closures, lang_items, never_type, linkage, | ^^^^^^^^^^ | = note: `#[warn(stable_features)]` on by default thread 'rustc' (1671953) panicked at compiler/rustc_codegen_ssa/src/mir/rvalue.rs:1114:5: assertion `left == right` failed left: __int8_t * __attribute__((aligned(8))) right: void * stack backtrace: 0: __rustc::rust_begin_unwind at /rustc/cbae9b4cae2b108f6a3d18cfe6075714bb739463/library/std/src/panicking.rs:679:5 1: core::panicking::panic_fmt at /rustc/cbae9b4cae2b108f6a3d18cfe6075714bb739463/library/core/src/panicking.rs:80:14 2: core::panicking::assert_failed_inner at /rustc/cbae9b4cae2b108f6a3d18cfe6075714bb739463/library/core/src/panicking.rs:452:17 3: core::panicking::assert_failed::<gccjit::types::Type, gccjit::types::Type> at /rustc/cbae9b4cae2b108f6a3d18cfe6075714bb739463/library/core/src/panicking.rs:407:5 4: transmute_scalar<rustc_codegen_gcc::builder::Builder> 5: codegen_transmute_operand<rustc_codegen_gcc::builder::Builder> at /home/bjorn/rust/compiler/rustc_codegen_ssa/src/mir/rvalue.rs:419:21 6: codegen_rvalue_operand<rustc_codegen_gcc::builder::Builder> at /home/bjorn/rust/compiler/rustc_codegen_ssa/src/mir/rvalue.rs:625:30 7: codegen_statement<rustc_codegen_gcc::builder::Builder> at /home/bjorn/rust/compiler/rustc_codegen_ssa/src/mir/statement.rs:37:52 ``` I'll need help with resolving that from the cg_gcc side (CC @antoyo). Fixes: #163527
Run cg_gcc tests with the correct compiler
Seems like we have been running the tests with the stage 0 compiler all along :surprised: The tests crash with:
```
[BUILD] mini_core
[BUILD] example
[AOT] mini_core_hello_world
warning: the feature `never_type` has been stable since 1.101.0-dev and no longer requires an attribute to enable
--> example/mini_core_hello_world.rs:4:44
|
4 | no_core, unboxed_closures, lang_items, never_type, linkage,
| ^^^^^^^^^^
|
= note: `#[warn(stable_features)]` on by default
thread 'rustc' (1671953) panicked at compiler/rustc_codegen_ssa/src/mir/rvalue.rs:1114:5:
assertion `left == right` failed
left: __int8_t * __attribute__((aligned(8)))
right: void *
stack backtrace:
0: __rustc::rust_begin_unwind
at /rustc/cbae9b4cae2b108f6a3d18cfe6075714bb739463/library/std/src/panicking.rs:679:5
1: core::panicking::panic_fmt
at /rustc/cbae9b4cae2b108f6a3d18cfe6075714bb739463/library/core/src/panicking.rs:80:14
2: core::panicking::assert_failed_inner
at /rustc/cbae9b4cae2b108f6a3d18cfe6075714bb739463/library/core/src/panicking.rs:452:17
3: core::panicking::assert_failed::<gccjit::types::Type, gccjit::types::Type>
at /rustc/cbae9b4cae2b108f6a3d18cfe6075714bb739463/library/core/src/panicking.rs:407:5
4: transmute_scalar<rustc_codegen_gcc::builder::Builder>
5: codegen_transmute_operand<rustc_codegen_gcc::builder::Builder>
at /home/bjorn/rust/compiler/rustc_codegen_ssa/src/mir/rvalue.rs:419:21
6: codegen_rvalue_operand<rustc_codegen_gcc::builder::Builder>
at /home/bjorn/rust/compiler/rustc_codegen_ssa/src/mir/rvalue.rs:625:30
7: codegen_statement<rustc_codegen_gcc::builder::Builder>
at /home/bjorn/rust/compiler/rustc_codegen_ssa/src/mir/statement.rs:37:52
```
I'll need help with resolving that from the cg_gcc side (CC @antoyo).
Fixes: #163527
Seems like we have been running the tests with the stage 0 compiler all along :surprised: The tests crash with:
I'll need help with resolving that from the cg_gcc side (CC @antoyo).
Fixes: #163527