profile
viewpoint

bjorn3/inline_asm_catalogue 8

Catalogue of asm! snippets to help the discussion about stabilization of inline asm

bjorn3/goodgame_empire_import 4

A importer for goodgame empire

bjorn3/fractals 3

Just some experiments

bjorn3/cargo-bisect-rustc-bot-jobs 1

This repo contains the cargo bisect-rustc jobs for my bot

bjorn3/goodgame_empire_helpers 1

Helpers for goodgame empire

bjorn3/addr2line 0

A cross-platform `addr2line` clone written in Rust, using `gimli`

bjorn3/backtrace-rs 0

Backtraces in Rust

issue commentrust-lang/unsafe-code-guidelines

Validity of references: Memory-related properties

And can we factor platform-specific constraints into this? For example x86_64-unknown-linux-gnu is limited to the lower half of the address space, the kernel owns the upper half.

At least on 32bit x86 it is possible to have a 3GB/1GB split. (CONFIG_VMSPLIT_3G) There is even a patch that allows programs to use the full 4GB address space: https://lwn.net/Articles/39925/

RalfJung

comment created time in an hour

pull request commentrust-lang/project-ffi-unwind

POF terminology, links & summary for older discussions

Crates like rayon and take_mut depend on the fact that function can only return normally or return with a catchable panic to avoid UB. rayon requires that all child threads are joined before the parent returns from the rayon::scope call and take_mut needs to abort on any non normal return to avoid a reference to uninitialized memory. Both would be UB if the forced unwind could cross the catch_unwind call. rayon also uses a AbortIfPanic type to protect against panics in rayon itself. If forced-unwinding across destructors was allowed, then AbortIfPanic would not help in any way.

BatmanAoD

comment created time in 3 hours

issue commentrust-analyzer/rust-analyzer

RA inserts "&mutself" for trait method stub, and missing space after `:`

I think this has been reported before, but I can't find the issue for it.

RalfJung

comment created time in 7 hours

startedaachman98/Sorcar

started time in 18 hours

issue commentphil-opp/blog_os

Comments for "https://os.phil-opp.com/async-await/"

HashMap is defined in libstd, not liballoc because it depends on a source of randomness. You can use the hashbrown crate with liballoc though.

utterances-bot

comment created time in 18 hours

pull request commentbjorn3/rustc_codegen_cranelift

Simplify target_arch conditional in codegen_crate

The jit module doesn't exist at all on wasm32 https://github.com/bjorn3/rustc_codegen_cranelift/blob/1e70c51f60abc544d9a325c77474190f1719e560/src/driver/mod.rs#L9-L10 because cranelift-simplejit fails to compile for wasm32 and as such had to be disabled at https://github.com/bjorn3/rustc_codegen_cranelift/blob/1e70c51f60abc544d9a325c77474190f1719e560/Cargo.toml#L44-L46

osa1

comment created time in a day

pull request commentbytecodealliance/wasmtime

x86_32: legalize br{z,nz}.i64

There are macOS failures again.

whitequark

comment created time in a day

pull request commentbytecodealliance/wasmtime

x86_32: legalize {istore,sload,uload}32.i64

Co-authored-by requires an email: Co-authored-by: bjorn3 <bjorn3@users.noreply.github.com>.

whitequark

comment created time in a day

issue commentrust-analyzer/rust-analyzer

Incoherent syntax highlighting in VS Code

It seems that the stretch crate is not found. Did you add it to Cargo.toml without reloading rust-analyzer afterwards? rust-analyzer doesn't currently handle changes to Cargo.toml.

Moxinilian

comment created time in a day

Pull request review commentbytecodealliance/wasmtime

💖 wiggle: escape rust keywords, allow witx literals

+(typename $union+  (enum u8+    $self+    $power+  )+)++(typename $self+  (union $union+    ;; A union variant that will expand to a strict keyword `Self`.+    (field $self (@witx pointer f32))+    ;; Oh it's true, that there's power in a union!

Is it appropriate to add a joke of this kind in the source?

katie-martin-fastly

comment created time in a day

Pull request review commentbytecodealliance/wasmtime

x86_32: legalize {istore,sload,uload}32.i64

+; Test the legalization of load32/store32.i64 instructions on x86_32.++test compile+target i686++function u0:0(i32, i32, i32) {+block0(v0: i32, v1: i32, v2: i32):+    v3 = iconcat v1, v2+    ; check:  v4 = fill v1+    ; nextln: v5 = fill v0+    ; nextln: store v4, v5+    istore32.i64 v3, v0+    return+}++function u0:1(i32) -> i32 {+block0(v0: i32):+    ; check: v7 = fill v0+    ; nextln: v4 = load.i32 v7+    v1 = sload32.i64 v0
    v1 = sload32.i32 v0

same for uload32.

whitequark

comment created time in 2 days

issue commentFLIF-hub/FLIF

ERROR: Unknown extension to write to: .pbm

You can find the full list of supported output format here:

https://github.com/FLIF-hub/FLIF/blob/aad2083c2508902f971b7a2aa2564eac2dbc6e3f/src/image/image.cpp#L69-L95

dclunie

comment created time in 2 days

issue commentFLIF-hub/FLIF

ERROR: Unknown extension to write to: .pbm

https://github.com/FLIF-hub/FLIF/pull/554

FLIF development has stopped since FLIF is superceded by FUIF and then again by JPEG XL (https://jpeg.org/jpegxl/index.html), which is based on a combination of Pik and FUIF. A royalty-free and open source reference implementation of JPEG XL is available on GitLab.

dclunie

comment created time in 2 days

issue commentbytecodealliance/wasmtime

Cranelift: can't legalize sload32

Using sload.I32 in the legalization and moving it to expand fixes it.

whitequark

comment created time in 2 days

issue commentbytecodealliance/wasmtime

Cranelift: can't legalize sload32

It seems that the ctrl typevar of sload32 is actually the pointer size. The output type is always i64. This means that you should use sload32.i32 when you have a 32bit pointer and sload32.i64 when you have a 64bit pointer.

let iAddr = &TypeVar::new(
    "iAddr",
    "An integer address type",
    TypeSetBuilder::new().ints(32..64).build(),
);
// ...
let p = &Operand::new("p", iAddr);
// ...
let iExt32 = &TypeVar::new(
    "iExt32",
    "An integer type with more than 32 bits",
    TypeSetBuilder::new().ints(64..64).build(),
);
let x = &Operand::new("x", iExt32);
let a = &Operand::new("a", iExt32);
// ...
ig.push(
    Inst::new(
        "sload32",
        r#"
    Load 32 bits from memory at ``p + Offset`` and sign-extend.

    This is equivalent to ``load.i32`` followed by ``sextend``.
    "#,
        &formats.load,
    )
    .operands_in(vec![MemFlags, p, Offset])
    .operands_out(vec![a])
    .can_load(true),
);

Only p and a are values. p can be i32 or i64, but a can only be i64.

whitequark

comment created time in 2 days

issue commentbytecodealliance/wasmtime

Cranelift: can't legalize sload32

if pos.func.dfg.value_type(args[0]) == ir::types::I64 {

this is an excerpt from the sload32 legalization. It seems that it does check the pointer type.

whitequark

comment created time in 2 days

issue commentrust-analyzer/rust-analyzer

100 CPU load and infinite loop

What is the backtrace for thread #15: tid = 0x3a7d3a, 0x0000000107255e09 rust-analyzerrowan::cursor::SyntaxNode::next_sibling_or_token::h7819dbb68e04663a + 25`?

giftal

comment created time in 2 days

Pull request review commentbytecodealliance/wasmtime

cranelift: add i64.{ishl,ushr,ashr} libcalls

 mod table; use self::call::expand_call; use self::globalvalue::expand_global_value; use self::heap::expand_heap_addr;-use self::libcall::expand_as_libcall;+pub use self::libcall::expand_as_libcall;
pub(crate) use self::libcall::expand_as_libcall;
whitequark

comment created time in 2 days

pull request commentbytecodealliance/wasmtime

x86_32: fix stack_addr encoding

The new backend might do that already, I've yet to look.

The new x86_64 backend barely has any instructions implemented: https://github.com/bytecodealliance/wasmtime/blob/09ccdc928579051792f4f1b90a076bead927495b/cranelift/codegen/src/isa/x64/lower.rs#L120

whitequark

comment created time in 2 days

issue commentbytecodealliance/wasmtime

Cranelift: can't legalize sload32

Nope

https://github.com/bytecodealliance/wasmtime/blob/01f46d02383be038465d86d5c2e22e2d2454d3ec/cranelift/wasm/src/code_translator.rs#L1819

it seems that the I64 part is really the output type and not the pointer type.

whitequark

comment created time in 2 days

issue commentbytecodealliance/wasmtime

Cranelift: can't legalize sload32

+    narrow.legalize(
+        def!(a = sload32.I64(flags, ptr, offset)),
+        vec![
+            def!(b = load.I32(flags, ptr, offset)),
+            def!(a = sextend.I64(b)),
+        ]
+    );

What @abrown is talking about is that the I64 part of sload32.I64 forces ptr to be an i64, not the output value.

whitequark

comment created time in 2 days

PR closed bjorn3/rustc_codegen_cranelift

Bump gimli from 0.20.0 to 0.21.0 dependencies rust

Bumps gimli from 0.20.0 to 0.21.0. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/gimli-rs/gimli/blob/master/CHANGELOG.md">gimli's changelog</a>.</em></p> <blockquote> <h2>0.21.0</h2> <p>Released 2020/05/12.</p> <h3>Breaking changes</h3> <ul> <li> <p>Minimum Rust version increased to 1.38.0.</p> </li> <li> <p>Replaced <code>read::Operation::Literal</code> with <code>Operation::UnsignedConstant</code> and <code>Operation::SignedConstant</code>. Changed <code>read::Operation::Bra</code> and <code>read::Operation::Skip</code> to contain the target offset instead of the bytecode. <a href="https://github-redirect.dependabot.com/gimli-rs/gimli/pull/479">#479</a></p> </li> <li> <p>Changed <code>write::Expression</code> to support references. Existing users can convert to use <code>Expression::raw</code>. <a href="https://github-redirect.dependabot.com/gimli-rs/gimli/pull/479">#479</a></p> </li> <li> <p>Replaced <code>write::AttributeValue::AnyUnitEntryRef</code> with <code>DebugInfoRef</code>. Renamed <code>write::AttributeValue::ThisUnitEntryRef</code> to <code>UnitRef</code>. <a href="https://github-redirect.dependabot.com/gimli-rs/gimli/pull/479">#479</a></p> </li> <li> <p>Added more optional features: <code>endian-reader</code> and <code>fallible-iterator</code>. <a href="https://github-redirect.dependabot.com/gimli-rs/gimli/pull/495">#495</a> <a href="https://github-redirect.dependabot.com/gimli-rs/gimli/pull/498">#498</a></p> </li> </ul> <h3>Added</h3> <ul> <li>Added <code>read::Expression::operations</code> <a href="https://github-redirect.dependabot.com/gimli-rs/gimli/pull/479">#479</a></li> </ul> <h3>Fixed</h3> <ul> <li> <p>Fixed newlines in <code>dwarfdump</code> example. <a href="https://github-redirect.dependabot.com/gimli-rs/gimli/pull/470">#470</a></p> </li> <li> <p>Ignore zero terminators when reading <code>.debug_frame</code> sections. <a href="https://github-redirect.dependabot.com/gimli-rs/gimli/pull/486">#486</a></p> </li> <li> <p>Increase the number of CFI register rules supported by <code>read::UnwindContext</code>. <a href="https://github-redirect.dependabot.com/gimli-rs/gimli/pull/487">#487</a></p> </li> <li> <p>Fixed version handling and return register encoding when reading <code>.eh_frame</code> sections. <a href="https://github-redirect.dependabot.com/gimli-rs/gimli/pull/493">#493</a></p> </li> </ul> <h3>Changed</h3> <ul> <li> <p>Added <code>EhFrame</code> and <code>DebugFrame</code> to <code>write::Sections</code>. <a href="https://github-redirect.dependabot.com/gimli-rs/gimli/pull/492">#492</a></p> </li> <li> <p>Improved performance of <code>write::LineProgram::generate_row</code>. <a href="https://github-redirect.dependabot.com/gimli-rs/gimli/pull/476">#476</a></p> </li> </ul> </tr></table> ... (truncated) </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/gimli-rs/gimli/commit/73c43d41249d24b05b6eb33863efd1fff6968d05"><code>73c43d4</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/gimli-rs/gimli/issues/499">#499</a> from philipc/release</li> <li><a href="https://github.com/gimli-rs/gimli/commit/862f3ceb74d8e2af178a8065d07538b8d569ab17"><code>862f3ce</code></a> Bump version to 0.21.0</li> <li><a href="https://github.com/gimli-rs/gimli/commit/d8a696369e3db5dc1c1757cd0e1e3a5f0fae4b58"><code>d8a6963</code></a> Update changelog</li> <li><a href="https://github.com/gimli-rs/gimli/commit/1bdd59da804bee79528ed49367c55183f0527a3f"><code>1bdd59d</code></a> Update <code>object</code> to 0.19</li> <li><a href="https://github.com/gimli-rs/gimli/commit/2467adb065c3ca31c117b8f0ec69b3860c259c65"><code>2467adb</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/gimli-rs/gimli/issues/498">#498</a> from alexcrichton/one-more-crate</li> <li><a href="https://github.com/gimli-rs/gimli/commit/7a0c08f8d93ca8ce3e09a13ee5a7316f3ae0669f"><code>7a0c08f</code></a> Remove dependency of <code>read</code> on <code>stable_deref_trait</code></li> <li><a href="https://github.com/gimli-rs/gimli/commit/be9ea4e340cdb3b8aa9daaffb768c3d12964c2ca"><code>be9ea4e</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/gimli-rs/gimli/issues/496">#496</a> from alexcrichton/remove-smallvec</li> <li><a href="https://github.com/gimli-rs/gimli/commit/91a4446d36c5b7d40f32ea4fc93725dc1bc391aa"><code>91a4446</code></a> Remove smallvec dependency</li> <li><a href="https://github.com/gimli-rs/gimli/commit/c4d93b186afac1b655693a03988de4c2ec105a55"><code>c4d93b1</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/gimli-rs/gimli/issues/497">#497</a> from alexcrichton/rm-arrayvec</li> <li><a href="https://github.com/gimli-rs/gimli/commit/d31004f908153773865d366677916fe40efd23ad"><code>d31004f</code></a> Remove the <code>arrayvec</code> dependency</li> <li>Additional commits viewable in <a href="https://github.com/gimli-rs/gimli/compare/0.20.0...0.21.0">compare view</a></li> </ul> </details> <br />

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


<details> <summary>Dependabot commands and options</summary> <br />

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
  • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
  • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
  • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language
  • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot dashboard:

  • Update frequency (including time of day and day of week)
  • Pull request limits (per update run and/or open at any time)
  • Automerge options (never/patch/minor, and dev/runtime dependencies)
  • Out-of-range updates (receive only lockfile updates, if desired)
  • Security updates (receive only security updates, if desired)

</details>

+12 -3

1 comment

2 changed files

dependabot-preview[bot]

pr closed time in 2 days

pull request commentbjorn3/rustc_codegen_cranelift

Bump gimli from 0.20.0 to 0.21.0

This requires a gimli bump in Cranelift first.

dependabot-preview[bot]

comment created time in 2 days

push eventbjorn3/rustc_codegen_cranelift

Ömer Sinan Ağacan

commit sha 6dd0246199f967b0f76d44c89c8eb1be2b312b2b

Dump clif with --emit llvm-ir in release mode Currently it's not possible to dump llvm-ir in release build. With this patch we allow it with `--emit llvm-ir`. In debug build we dump clif always as before. Fixes #1020

view details

Ömer Sinan Ağacan

commit sha c0ad988a3a994720904be8d77e92004daadda91c

Update src/pretty_clif.rs Co-authored-by: bjorn3 <bjorn3@users.noreply.github.com>

view details

bjorn3

commit sha 1e70c51f60abc544d9a325c77474190f1719e560

Merge pull request #1022 from osa1/clif_dump_in_release_mode Dump clif with --emit llvm-ir in release mode

view details

push time in 2 days

PR merged bjorn3/rustc_codegen_cranelift

Dump clif with --emit llvm-ir in release mode

Currently it's not possible to dump llvm-ir in release build. With this patch we allow it with --emit llvm-ir. In debug build we dump clif always as before.

Fixes #1020

+6 -4

1 comment

3 changed files

osa1

pr closed time in 2 days

issue closedbjorn3/rustc_codegen_cranelift

Make --emit llvm-ir emit clif ir

This can be useful when testing.

closed time in 2 days

bjorn3

pull request commentbjorn3/rustc_codegen_cranelift

Dump clif with --emit llvm-ir in release mode

Thanks!

osa1

comment created time in 2 days

push eventbjorn3/rustc_codegen_cranelift

Ömer Sinan Ağacan

commit sha acbfa06ea2aa298de1591c8bb9a483151f254c2d

Mark blocks that call cold funs as cold (#1021)

view details

push time in 2 days

PR merged bjorn3/rustc_codegen_cranelift

Mark blocks that call cold funs as cold

@bjorn3 I couldn't test this as I'm not getting any clif output even when I don't pass --release to test.sh.

I'm also not sure about how to format this code, it seems like the toolchain we use don't have rustfmt.

+12 -2

3 comments

2 changed files

osa1

pr closed time in 2 days

pull request commentbjorn3/rustc_codegen_cranelift

Mark blocks that call cold funs as cold

Thanks a lot!

osa1

comment created time in 2 days

Pull request review commentAmanieu/parking_lot

Allow lock guards to be sent to other threads

 in the Rust standard library: 18. Optional support for [serde](https://docs.serde.rs/serde/).  Enable via the     feature `serde`.  **NOTE!** this support is for `Mutex`, `ReentrantMutex`,     and `RwLock` only; `Condvar` and `Once` are not currently supported.+19. Lock guards can be sent to other threads when the `send_guard` geature is
19. Lock guards can be sent to other threads when the `send_guard` feature is
Amanieu

comment created time in 2 days

Pull request review commentrust-lang/rust

compare consts using ptr equality

 impl<'tcx> Borrow<[Predicate<'tcx>]> for Interned<'tcx, List<Predicate<'tcx>>> {     } } -impl<'tcx> Borrow<Const<'tcx>> for Interned<'tcx, Const<'tcx>> {-    fn borrow<'a>(&'a self) -> &'a Const<'tcx> {-        &self.0+impl<'tcx> Borrow<super::sty::InternedConst<'tcx>> for Interned<'tcx, Const<'tcx>> {+    fn borrow<'a>(&'a self) -> &'a super::sty::InternedConst<'tcx> {+        unsafe { mem::transmute(self) }

Missed the #[repr(C)].

lcnr

comment created time in 2 days

Pull request review commentbjorn3/rustc_codegen_cranelift

Dump clif with --emit llvm-ir in release mode

 pub(crate) fn write_clif_file<'tcx>(     mut clif_comments: &CommentWriter,     value_ranges: Option<&cranelift_codegen::ValueLabelsRanges>, ) {+    if !(cfg!(debug_assertions) || tcx.sess.opts.output_types.contains_key(&OutputType::LlvmAssembly)) {

I have a slight preference for

    if !cfg!(debug_assertions) && !tcx.sess.opts.output_types.contains_key(&OutputType::LlvmAssembly) {
osa1

comment created time in 2 days

Pull request review commentrust-lang/chalk

Model function ABI in the Rust IR

 impl Debug for RawId {     } } +#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]+pub enum ChalkFnAbi {+    Rust,+    C,

The system ABI is also stable. The standard library also uses rust-intrinsic, rust-call, platform-intrinsic and maybe some other ABI's. Maybe use a string instead to be able to represent all ABI's without changes to chalk.

Mcat12

comment created time in 2 days

Pull request review commentrust-lang/rust

compare consts using ptr equality

 impl<'tcx> Borrow<[Predicate<'tcx>]> for Interned<'tcx, List<Predicate<'tcx>>> {     } } -impl<'tcx> Borrow<Const<'tcx>> for Interned<'tcx, Const<'tcx>> {-    fn borrow<'a>(&'a self) -> &'a Const<'tcx> {-        &self.0+impl<'tcx> Borrow<super::sty::InternedConst<'tcx>> for Interned<'tcx, Const<'tcx>> {+    fn borrow<'a>(&'a self) -> &'a super::sty::InternedConst<'tcx> {+        unsafe { mem::transmute(self) }

Const and InternedConst may have a different layout.

lcnr

comment created time in 2 days

Pull request review commentrust-lang/rust

compare consts using ptr equality

 impl<'tcx> Borrow<[Predicate<'tcx>]> for Interned<'tcx, List<Predicate<'tcx>>> {     } } -impl<'tcx> Borrow<Const<'tcx>> for Interned<'tcx, Const<'tcx>> {-    fn borrow<'a>(&'a self) -> &'a Const<'tcx> {-        &self.0+impl<'tcx> Borrow<super::sty::InternedConst<'tcx>> for Interned<'tcx, Const<'tcx>> {+    fn borrow<'a>(&'a self) -> &'a super::sty::InternedConst<'tcx> {+        unsafe { mem::transmute(self) }

Const and InternedConst may have a different layout.

lcnr

comment created time in 2 days

Pull request review commentbjorn3/rustc_codegen_cranelift

Dump clif with --emit llvm-ir in release mode

 pub(crate) fn trans_fn<'clif, 'tcx, B: Backend + 'static>(     let local_map = fx.local_map;     let cold_blocks = fx.cold_blocks; -    #[cfg(debug_assertions)]-    crate::pretty_clif::write_clif_file(cx.tcx, "unopt", instance, &context.func, &clif_comments, None);+    if cfg!(debug_assertions) || cx.tcx.sess.opts.output_types.contains_key(&OutputType::LlvmAssembly) {

Maybe move this if into write_clif_file?

osa1

comment created time in 2 days

Pull request review commentbjorn3/rustc_codegen_cranelift

Mark blocks that call cold funs as cold

 pub(crate) fn codegen_terminator_call<'tcx>(      // FIXME mark the current block as cold when calling a `#[cold]` function.

Please remove this FIXME and ensure that there is exactly one blank line between the normalize_erasing_late_bound_regions above and the let destination below.

osa1

comment created time in 2 days

pull request commentbjorn3/rustc_codegen_cranelift

Mark blocks that call cold funs as cold

I'm also not sure about how to format this code, it seems like the toolchain we use don't have rustfmt.

I don't really use rustfmt. I try to follow it's style as much as possible, but I always forget to actually run rustfmt.

One thing that I'm not sure about is why we we move the "else" branch of brz, that is, the block that we jump to when is_positive() returns false is moved. I think the other block should've been moved? Maybe I'm reading the clif output wrong? Or maybe true is represented as 0?

    fn9 = colocated u0:14 sig9 ; Instance { def: Item(DefId(0:8 ~ std_example[317d]::b[0])), substs: [] }
    fn10 = colocated u0:7 sig10 ; Instance { def: Item(DefId(0:7 ~ std_example[317d]::a[0])), substs: [] }

Surprisingly fn9 is b and fn10 is a.

osa1

comment created time in 2 days

push eventbjorn3/rustc_codegen_cranelift

bjorn3

commit sha 41d257cf22ce85000f9198621f91094b96c04abd

[WIP]

view details

push time in 2 days

CommitCommentEvent

push eventbjorn3/rustc_codegen_cranelift

Ömer Sinan Ağacan

commit sha bb4cc18cf27c5e0cccfd91e5da489321222d52aa

Add simple-raytracer to .gitignore (#1023)

view details

push time in 2 days

pull request commentbjorn3/rustc_codegen_cranelift

Add simple-raytracer to .gitignore

Thanks!

osa1

comment created time in 2 days

Pull request review commentrust-lang/chalk

Add function def clauses

+use super::*;++#[test]+fn fn_def_is_well_formed() {+    test! {+        program {+            fn foo() {}+        }+        goal {+            WellFormed(foo)+        } yields {+            "Unique"+        }+    }+}++#[test]+fn fn_def_is_sized() {+    test! {+        program {+            #[lang(sized)]+            trait Sized { }++            fn foo() {}+        }+        goal {+            foo: Sized+        } yields {+            "Unique"+        }+    }+}++#[test]+fn fn_def_is_copy() {+    test! {+        program {+            #[lang(sized)]+            trait Copy { }++            fn foo() {}+        }+        goal {+            foo: Copy+        } yields {+            "Unique"+        }+    }+}++#[test]+fn fn_def_is_clone() {+    test! {+        program {+            #[lang(sized)]

This should be clone, not sized.

jackh726

comment created time in 3 days

Pull request review commentrust-lang/chalk

Add function def clauses

+use super::*;++#[test]+fn fn_def_is_well_formed() {+    test! {+        program {+            fn foo() {}+        }+        goal {+            WellFormed(foo)+        } yields {+            "Unique"+        }+    }+}++#[test]+fn fn_def_is_sized() {+    test! {+        program {+            #[lang(sized)]+            trait Sized { }++            fn foo() {}+        }+        goal {+            foo: Sized+        } yields {+            "Unique"+        }+    }+}++#[test]+fn fn_def_is_copy() {+    test! {+        program {+            #[lang(sized)]

This should be copy, not sized.

jackh726

comment created time in 3 days

pull request commentbytecodealliance/wasmtime

Multi-value return support on aarch64/Wasmtime.

:+1:

cfallin

comment created time in 3 days

Pull request review commentrust-lang/rust

compare consts using ptr equality

 impl<'tcx> TyS<'tcx> { }  /// Typed constant value.-#[derive(Copy, Clone, Debug, Hash, RustcEncodable, RustcDecodable, Eq, PartialEq, Ord, PartialOrd)]+#[derive(Debug, Hash, RustcEncodable, RustcDecodable, Eq, Ord, PartialOrd)] #[derive(HashStable)] pub struct Const<'tcx> {     pub ty: Ty<'tcx>,      pub val: ConstKind<'tcx>,++    /// We compare `Const` by pointer equality. This would be incorrect+    /// if we were able to create Const values on the stack.+    ///+    /// Only allow the creation of consts using `tcx.mk_const(ty, val)`.+    pub _priv: PrivateMarker,

Why is this pub?

lcnr

comment created time in 3 days

pull request commentAmanieu/parking_lot

Allow lock guards to be sent to other threads

A better alternative than simply breaking code when enabling the deadlock_detection feature flag would be to add a new sendable_guard feature flag to enable this and add a compile_error! when both feature flags are enabled. While this does still violate the additive assumption, this does makes it a lot harder to accidentally depend on the Sendness of lock guards.

Amanieu

comment created time in 3 days

pull request commentAmanieu/parking_lot

Allow lock guards to be sent to other threads

In those cases it is often choosing between two or more backends for a crate. This means that 1. the target executable is likely the one enabling the feature flag and 2. you can't accidentally depend on a feature flag being disabled, as you have to explicitly enable one feature flag to break another one. You can't just have a crate compiling with no feature flags enabled at all and then break when you enable one feature flag.

Amanieu

comment created time in 3 days

issue commentbytecodealliance/wasmtime

Unable to run AssemblyScript WASI

__rtti_base is part of the AssemblyScript runtime. Wasmtime doesn't allow any exported globals other than a few specific ones:

okalousek

comment created time in 3 days

Pull request review commentbytecodealliance/wasmtime

x86: add encoding for bnot.b1

+test binemit+test run++target x86_64++function u0:323() -> b1 system_v {
function u0:323() -> b1 {

Use the default calling convention to fix test run on Windows.

whitequark

comment created time in 3 days

Pull request review commentbytecodealliance/wasmtime

[cranelift-interpreter] Add more arithmetic operations

 impl Interpreter {                 let arg1 = frame.get(&args[0]);                 let arg2 = frame.get(&args[1]);                 let result = match opcode {-                    Iadd => binary_op!(Add::add[arg1, arg2]; [I8, I16, I32, I64, F32, F64]; inst),-                    Isub => binary_op!(Sub::sub[arg1, arg2]; [I8, I16, I32, I64, F32, F64]; inst),+                    Iadd => binary_op!(Add::add[arg1, arg2]; [I8, I16, I32, I64]; inst),

iadd supports i128 as type. isub and imul don't have a legalization for i128 yet, but it would be nice if they supported i128 in the interpreter anyway.

abrown

comment created time in 3 days

pull request commentAmanieu/parking_lot

Allow lock guards to be sent to other threads

Cargo expects features to be additive. This means that enabling features must never break code. It must only allow more code. By making the deadlock detection feature disable the Send impl for MutexGuard you are breaking code.

Amanieu

comment created time in 3 days

pull request commentbytecodealliance/wasmtime

Multi-value return support on aarch64/Wasmtime.

Keeping the abi simple is fine, but I want to have all the primitives necessary to implement full SystemV abi support from the clif ir producer side.

cfallin

comment created time in 3 days

issue commentbytecodealliance/wasmtime

peepmatic-macro tests fail when running cross-architecture via qemu

peepmatic-macro is a proc-macro, which means that it must be compiled for the host architecture. How did you setup cargo to run tests using qemu?

cfallin

comment created time in 3 days

pull request commentbytecodealliance/wasmtime

Multi-value return support on aarch64/Wasmtime.

The SystemV abi on AArch64 uses x0 and x1 to return pairs of integers. Could you please do that in Cranelif too? Even if only in the non baldrdash variant of the abi?

cfallin

comment created time in 4 days

pull request commentbytecodealliance/wasmtime

Replace ExtractLane format with BinaryImm8

I am currently using neither insertlane nor extractlane. I also don't use Format or InstructionData either.

abrown

comment created time in 4 days

Pull request review commentgoogle/evcxr

Fix loading crates with a hyphen when using `extern crate`

 impl EvalContext {                     syn::Stmt::Item(syn::Item::ExternCrate(syn::ItemExternCrate {                         ident, ..                     })) => {-                        let crate_name = ident.to_string();+                        let mut crate_name = ident.to_string();                         if !self.dependency_lib_names()?.contains(&crate_name) {                             self.state                                 .external_deps                                 .entry(crate_name.clone())                                 .or_insert_with(|| {+                                    // For RFC0940+                                    if crate_name.contains("_") {+                                        let crates_client = SyncClient+                                            ::new("evcxr", std::time::Duration::from_millis(500)).unwrap();

cargo-edit has an implementation of this that uses the local registry instead of the crates.io api: fuzzy_query_registry_index

Ma27

comment created time in 4 days

pull request commentbytecodealliance/wasmtime

x86: add encoding for bnot.b1

@abrown Your review doesn't contain any code comments.

whitequark

comment created time in 4 days

issue openedbjorn3/rustc_codegen_cranelift

Make --emit llvm-ir emit clif ir

This can be useful when testing.

created time in 4 days

issue commentrust-analyzer/rust-analyzer

"command 'rust-analyzer.*' not found" in vscode with remote SSH

Have you also installed the extension on the remote machine? I believe that is required.

emakryo

comment created time in 4 days

issue commentbytecodealliance/wasmtime

Dependabot can't resolve your Rust dependency files

Adding a dummy build.rs next to every Cargo.toml containing only fn main() {} may work.

The error is emitted at https://github.com/rust-lang/cargo/blob/d18e4b36e7dd7a02a962d390f9c596a3df9a8d8c/src/cargo/util/toml/mod.rs#L1091-L1100

dependabot-preview[bot]

comment created time in 4 days

issue commentbytecodealliance/wasmtime

assertion failed: prev.start > max in wasmtime::frame_info::register

Do you have a backtrace or full panic message (including assertion location)?

roman-kashitsyn

comment created time in 4 days

issue commentbjorn3/rustc_codegen_cranelift

Windows support

The branch now also depends on https://github.com/bytecodealliance/wasmtime/pull/1767 for the object 0.19.0 update. (You need to merge both PR's into one branch)

FireFlyForLife

comment created time in 4 days

push eventbjorn3/rustc_codegen_cranelift

bjorn3

commit sha 56de8ee9d8ec53bd979916fa00e5a53ad55618f0

Update for api change from object update PR

view details

push time in 4 days

push eventbjorn3/wasmtime

bjorn3

commit sha 81cef8de45a589b080710e1c5daa4c66680752ce

Bump object to 0.19.0

view details

push time in 4 days

PR opened bytecodealliance/wasmtime

Bump object to 0.19.0

All changes: https://github.com/gimli-rs/object/compare/0.18.0...0.19.0

Changes affecting the writing part of object:

https://github.com/gimli-rs/object/commit/6ee7638493b14d682c3eb689725976b7d4be6552 fixes the symbol class for undefined symbols when writing COFF files. (required for Windows support in cg_clif) https://github.com/gimli-rs/object/commit/47856a29c847467d925713066781b9164a096d1d and https://github.com/gimli-rs/object/commit/59a2cb6b521c46dc251ec3bfaf181b4a83759fc4 add basic support for AArch64 ELF file writing. (required for AArch64 support in cg_clif) https://github.com/gimli-rs/object/commit/5fccab91fde14638db1af78847477e8361354a66 removes the target-lexicon dependency.

+57 -17

0 comment

3 changed files

pr created time in 4 days

create barnchbjorn3/wasmtime

branch : bump_object_to_0_19

created branch time in 4 days

pull request commentrust-lang/rust

Print environment variables accessed by rustc as special comments into depinfo files

I don't think I've ever come across a non-UTF-8 name for an environment variable, so it seems like leaving them out of scope wouldn't be the end of the world.

I have seen files with enters in the filename on a hacked site. I couldn't remove them using ftp, as ftp assumes that filenames don't contain enters.

petrochenkov

comment created time in 4 days

push eventbjorn3/rustc_codegen_cranelift

bjorn3

commit sha 1c76bdc53a7e1719ea81ffe737cb7e52a9a15ad7

Remove already fixed FIXME in driver/jit.rs

view details

push time in 4 days

pull request commentrust-lang/rust

Make pointer offset methods/intrinsics const

Try using isize and usize. Those are integers of the same size as a pointer.

josephlr

comment created time in 5 days

push eventbjorn3/rustc_codegen_cranelift

bjorn3

commit sha 7b3dc2597783e45a900df125c1f61202b45b7018

Revert unnecessary change

view details

push time in 5 days

issue commentphilberty/gccrs

OpenMP, OpenACC

From talking to some friends in university in physics they liked openmp only because you could write single threaded code in C then throw in some pragma's and know it did the threading stuff.

Same thing with rayon: replace iter() with par_iter().

benman1

comment created time in 5 days

issue commentphilberty/gccrs

OpenMP, OpenACC

Is OpenMP actually a good fit for rust? There is already for example rayon, which both supports turning usage of regular iterators into parallel iterators by replacing .iter() with .par_iter() and has a thread pool. The standard library has the Mutex type for synchronization which makes it impossible to forget to lock before accessing data. All these things combined pretty much cover all features of OpenMP, right?

benman1

comment created time in 5 days

issue commentbytecodealliance/wasmtime

rust-crypto breaks cargo build --target wasm32-wasi

rust-crypto seems to not support wasm: https://github.com/DaGenix/rust-crypto/issues/437#issuecomment-395915033. The author of that comment has forked it to add wasm support: https://github.com/buttercup/rust-crypto-wasm.

MikeCamel

comment created time in 5 days

Pull request review commentkkawakam/rustyline

More sane behavior if terminal size is zero

 fn get_win_size<T: AsRawFd + ?Sized>(fileno: &T) -> (usize, usize) {     unsafe {         let mut size: libc::winsize = zeroed();         match win_size(fileno.as_raw_fd(), &mut size) {-            Ok(0) => (size.ws_col as usize, size.ws_row as usize), // TODO getCursorPosition+            Ok(0) => {+                // In linux pseudo-terminals are created with dimensions of+                // zero. If host application didn't initialize the correct+                // size before start we treat zero size as 80 columns and+                // inifinite rows+                let cols = if size.ws_col == 0 {+                    80+                } else {+                    size.ws_col as usize+                };+                let rows = if size.ws_row == 0 {+                    0+                } else {+                    usize::max_value()+                };

Also should it use 24 as fallback instead of usize::max_value()?

tailhook

comment created time in 5 days

Pull request review commentkkawakam/rustyline

More sane behavior if terminal size is zero

 fn get_win_size<T: AsRawFd + ?Sized>(fileno: &T) -> (usize, usize) {     unsafe {         let mut size: libc::winsize = zeroed();         match win_size(fileno.as_raw_fd(), &mut size) {-            Ok(0) => (size.ws_col as usize, size.ws_row as usize), // TODO getCursorPosition+            Ok(0) => {+                // In linux pseudo-terminals are created with dimensions of+                // zero. If host application didn't initialize the correct+                // size before start we treat zero size as 80 columns and+                // inifinite rows+                let cols = if size.ws_col == 0 {+                    80+                } else {+                    size.ws_col as usize+                };+                let rows = if size.ws_row == 0 {+                    0+                } else {+                    usize::max_value()+                };
                let rows = if size.ws_row == 0 {
                    usize::max_value()
                } else {
                    size.ws_row as usize
                };
tailhook

comment created time in 5 days

pull request commentsharkdp/hexyl

Add unit system (closes #44)

The following my help: https://help.github.com/en/github/committing-changes-to-your-project/creating-a-commit-with-multiple-authors

ErichDonGubler

comment created time in 5 days

pull request commentrust-lang/compiler-builtins

Use crate visibility for traits

The fact that these traits are exported has been useful to me while debugging miscompilations by cg_clif around 128bit int handling. Because these traits are exported, I can just import them after copying an intrinsic provided by compiler-builtins to the test crate. I don't have to copy all the methods provided by these traits too until I actually want to change them.

tmiasko

comment created time in 5 days

push eventbjorn3/rustc_codegen_cranelift

bjorn3

commit sha 66681a2055ff8af9748e538296094746de74175e

Make examples work on Windows

view details

push time in 5 days

issue commentrust-analyzer/rust-analyzer

cargo check output not showing up

There happens to be a feature in my Cargo.toml that requires nightly

By default rust-analyzer passes --all-features to cargo check. You can use "rust-analyzer.cargo.allFeatures": false to prevent this.

schungx

comment created time in 5 days

issue commentbjorn3/rustc_codegen_cranelift

Windows support

The branch depends on https://github.com/bytecodealliance/wasmtime/pull/1670 and an update to object 0.19.0.

FireFlyForLife

comment created time in 5 days

push eventbjorn3/rustc_codegen_cranelift

bjorn3

commit sha 74c66427390a1b159d2c6784605e919b66674164

Fix abi incompatibility with compiler-builtins

view details

push time in 5 days

issue commentbjorn3/rustc_codegen_cranelift

Windows support

I got working support for cross compilation from Linux to MinGW on the wip_windows_support branch. For reference: see the comment thread starting at https://github.com/bytecodealliance/wasmtime/pull/1510#issuecomment-633693913.

FireFlyForLife

comment created time in 5 days

push eventbjorn3/rustc_codegen_cranelift

bjorn3

commit sha 21ff2b2685d9d6d56cc466f65db7d10317576d42

Changes

view details

bjorn3

commit sha 1661004373cade622a998a49ed37e0536b9c6e0b

Fix abi incompatibility with compiler-builtins

view details

push time in 5 days

pull request commentbytecodealliance/wasmtime

Always check if struct-return parameter is needed

The problem was in a compiler-builtins hack to match the abi LLVM expects. It uses #[repr(simd)] which is not implemented in cg_clif.

https://github.com/rust-lang/compiler-builtins/blob/2541f27e8c3d61505815c0492c045b7d17436e35/src/macros.rs#L160

simple-raytracer works fine now in wine.

teapotd

comment created time in 5 days

Pull request review commentsoftdevteam/yk

Codegen calls.

 impl CompiledTrace {         // For now a compiled trace always returns whatever has been left in register RAX. We also         // assume for now that this will be a `u64`.         let func: fn() -> u64 = unsafe { mem::transmute(self.mc.ptr(dynasmrt::AssemblyOffset(0))) };-        func()+        self.exec_trace(func)+    }++    /// Jump to JITted code. This is a separate unmangled function to make it easy to set a+    /// debugger breakpoint right before entering the trace.+    #[no_mangle]+    fn exec_trace(&self, t_fn: fn() -> u64) -> u64 {

It seems that optimizations are disabled by default for tests: https://doc.rust-lang.org/cargo/reference/profiles.html#test

vext01

comment created time in 5 days

issue commentrust-lang/rust

error[E0433]: failed to resolve: unresolved import for libc crate

The fact that there is no span for the error is an error on the rustc side in my opinion.

bjorn3

comment created time in 5 days

delete branch bjorn3/wasmtime

delete branch : patch-2

delete time in 5 days

pull request commentrust-lang/rust

rustc_mir: track inlined callees in SourceScopeData.

Blocked on the resolution of #69060 (which might be soon).

Perf runs are much more stable now.

eddyb

comment created time in 5 days

issue commentphil-opp/blog_os

Comments for "https://os.phil-opp.com/testing/"

The test-success-exit-code = 33 needs to be in the package.metadata.bootimage section. If you uncomment the test section, it becomes part of that section.

utterances-bot

comment created time in 5 days

push eventbjorn3/rustc_codegen_cranelift

bjorn3

commit sha a34f10a4260aad8aacd7a7874cb5ccdf9b766435

[WIP]

view details

bjorn3

commit sha 5df5a28f574d9d8b306da593a745918a72071217

Disable atomic shim

view details

bjorn3

commit sha fec09ecfe14e4c38c0e781d2ff70dd8b75ab4b65

[WIP]

view details

push time in 6 days

pull request commentbytecodealliance/wasmtime

Always check if struct-return parameter is needed

I had to copy a few object files from the cg_llvm sysroot, disable the atomic shim in cg_clif and update object for a bugfix. It now gives the following when run in wine:

wine ./target/out/std_example.exe                                                                                       bjorn@laptopbjorn-lenovo
some <unknown> text
cargo:rustc-link-lib=z
9.974182
4.9245777
2.3
1.5165751
2
3
1
2.3
5.29
1.2016338
5.29
wine: Unhandled page fault on read access to 0x00000000 at address 0x8a8a39 (thread 002a), starting debugger...

will try the other PR tomorrow.

teapotd

comment created time in 6 days

push eventbjorn3/rustc_codegen_cranelift

bjorn3

commit sha 1b6a67d282ab0388949c8eae4289386554599419

Copy necessary runtime objects to the cg_clif sysroot

view details

push time in 6 days

create barnchbjorn3/rustc_codegen_cranelift

branch : wip_windows_support

created branch time in 6 days

pull request commentbytecodealliance/wasmtime

Always check if struct-return parameter is needed

I was trying to get it compiling first. With the latest changes and a few changes at my side to shim some inline asm with aborts it now compiles libstd fine. Linking fails for cross-compiling from linux using mingw:

  = note: x86_64-w64-mingw32-gcc: error: rsbegin.o: No such file or directory
          x86_64-w64-mingw32-gcc: error: rsend.o: No such file or directory

This is probably a problem with my setup though.

teapotd

comment created time in 6 days

issue closedbytecodealliance/wasmtime

Cranelift: Infinite loop inside of Layout::renumber_insts

test compile
set is_pic
target x86_64-pc-windows-gnu

function u0:43(i64, i64, i64) windows_fastcall {
; symbol _ZN61_$LT$core..num..NonZeroU128$u20$as$u20$core..str..FromStr$GT$8from_str17hc6d5a93f1d348c98E
; instance Instance { def: Item(DefId(0:11611 ~ core[5f76]::num[0]::{{impl}}[292]::from_str[0])), substs: [] }
; sig ([&str]; c_variadic: false)->result::Result<num::NonZeroU128, num::ParseIntError>

; kind  loc.idx   param    pass mode                            ty
; ret   _0      = v0       ByRef { sized: true }                result::Result<num::NonZeroU128, num::ParseIntError>
; arg   _1      = v1, v2   ByValPair(types::I64, types::I64)    &str

; kind  local ty                              size align (abi,pref)
; stack _1    &str                             16b 8, 8              storage=ss0
; stack _2    option::Option<num::NonZeroU128>   16b 8, 8              storage=ss1
; ssa   _3    u128                             16b 8, 8
; stack _4    result::Result<u128, num::ParseIntError>   24b 8, 8              storage=ss2
; stack _5    result::Result<u128, num::ParseIntError>   24b 8, 8              storage=ss3
; stack _6    &str                             16b 8, 8              storage=ss4
; ssa   _7    isize                             8b 8, 8
; stack _8    num::ParseIntError                1b 1, 8              storage=ss5
; stack _9    num::ParseIntError                1b 1, 8              storage=ss6
; stack _10   num::ParseIntError                1b 1, 8              storage=ss7
; ssa   _11   u128                             16b 8, 8
; stack _12   num::ParseIntError                1b 1, 8              storage=ss8

    ss0 = explicit_slot 16
    ss1 = explicit_slot 16
    ss2 = explicit_slot 24
    ss3 = explicit_slot 24
    ss4 = explicit_slot 16
    ss5 = explicit_slot 1
    ss6 = explicit_slot 1
    ss7 = explicit_slot 1
    ss8 = explicit_slot 1
    gv0 = symbol colocated u1:22 ; trap at Instance { def: Item(DefId(0:11611 ~ core[5f76]::num[0]::{{impl}}[292]::from_str[0])), substs: [] } (_ZN61_$LT$core..num..NonZeroU128$u20$as$u20$core..str..FromStr$GT$8from_str17hc6d5a93f1d348c98E): [corruption] Hit unreachable code.
    gv1 = symbol colocated u1:23 ; alloc32624
    sig0 = (i64, i64, i64, i32) windows_fastcall
    sig1 = (i64, i64) windows_fastcall
    sig2 = (i128) -> i128 windows_fastcall
    sig3 = (i64) -> i32 windows_fastcall
    sig4 = (i8) -> i8 windows_fastcall
    sig5 = (i64, i8) windows_fastcall
    sig6 = (i64, i128, i8) windows_fastcall
    fn0 = u0:283 sig0 ; Instance { def: Item(DefId(0:677 ~ core[5f76]::num[0]::from_str_radix[0])), substs: [u128] }
    fn1 = u0:284 sig1 ; Instance { def: Item(DefId(0:5800 ~ core[5f76]::result[0]::{{impl}}[36]::into_result[0])), substs: [u128, num::ParseIntError] }
    fn2 = colocated u0:17 sig2 ; Instance { def: Item(DefId(0:11011 ~ core[5f76]::num[0]::{{impl}}[52]::new[0])), substs: [] }
    fn3 = u0:263 sig3 ; puts
    fn4 = u0:268 sig4 ; Instance { def: Item(DefId(0:1846 ~ core[5f76]::convert[0]::{{impl}}[4]::from[0])), substs: [num::ParseIntError] }
    fn5 = u0:285 sig5 ; Instance { def: Item(DefId(0:5802 ~ core[5f76]::result[0]::{{impl}}[36]::from_error[0])), substs: [num::NonZeroU128, num::ParseIntError] }
    fn6 = u0:286 sig6 ; Instance { def: Item(DefId(0:5279 ~ core[5f76]::option[0]::{{impl}}[0]::ok_or[0])), substs: [num::NonZeroU128, num::ParseIntError] }
    jt0 = jump_table [block4, block6]

                                block0(v0: i64, v1: i64, v2: i64):
                                    nop 
; write_cvalue: Addr(Pointer { base: Stack(ss0), offset: Offset32(0) }, None): &str <- ByValPair(v1, v2): &str
                                    stack_store v1, ss0
                                    stack_store v2, ss0+8
                                    jump block1

                                block1:
                                    nop 
; write_cvalue: Addr(Pointer { base: Stack(ss4), offset: Offset32(0) }, None): &str <- ByRef(Pointer { base: Stack(ss0), offset: Offset32(0) }, None): &str
@0004                               v3 = stack_load.i64 ss0
@0004                               v4 = stack_load.i64 ss0+8
@0004                               stack_store v3, ss4
@0004                               stack_store v4, ss4+8
; 
; _5 = const num::from_str_radix::<u128>(move _6, const 10u32)
@0003                               v5 = iconst.i32 10
@0003                               v6 = stack_load.i64 ss4
@0003                               v7 = stack_load.i64 ss4+8
@0003                               v8 = stack_addr.i64 ss3
@0003                               call fn0(v8, v6, v7, v5)
@0003                               jump block2

                                block2:
@0003                               nop 
; 
; _4 = const <result::Result<u128, num::ParseIntError> as ops::r#try::Try>::into_result(move _5)
@0002                               v9 = stack_addr.i64 ss3
@0002                               v10 = stack_addr.i64 ss2
@0002                               call fn1(v10, v9)
@0002                               jump block3

                                block3:
@0002                               nop 
@0007                               v11 = stack_load.i8 ss2
@0007                               v12 = uextend.i64 v11
; write_cvalue: Var(_7): isize <- ByVal(v12): isize
; 
; switchInt(move _7)
@0007                               jump block12

                                block12:
@0007                               br_table.i64 v12, block5, jt0

                                block4:
@0007                               nop 
; write_cvalue: Var(_11): u128 <- ByRef(Pointer { base: Stack(ss2), offset: Offset32(8) }, None): u128
@0001                               v13 = stack_addr.i64 ss2
@0001                               v14 = load.i128 v13+8
; write_cvalue: Var(_3): u128 <- ByVal(v14): u128
; 
; _2 = const num::NonZeroU128::new(move _3)
@0000                               v15 = call fn2(v14)
; write_cvalue: Addr(Pointer { base: Stack(ss1), offset: Offset32(0) }, None): option::Option<num::NonZeroU128> <- ByVal(v15): option::Option<num::NonZeroU128>
@0000                               v16 = stack_addr.i64 ss1
@0000                               store v15, v16
@0000                               jump block9

                                block5:
@0000                               nop 
; 
; unreachable
@0002                               v17 = global_value.i64 gv0
@0002                               v18 = call fn3(v17)
@0002                               trap unreachable

                                block6:
@0002                               nop 
; write_cvalue: Addr(Pointer { base: Stack(ss5), offset: Offset32(0) }, None): num::ParseIntError <- ByRef(Pointer { base: Stack(ss2), offset: Offset32(1) }, None): num::ParseIntError
@0007                               v19 = stack_load.i8 ss2+1
@0007                               stack_store v19, ss5
; write_cvalue: Addr(Pointer { base: Stack(ss7), offset: Offset32(0) }, None): num::ParseIntError <- ByRef(Pointer { base: Stack(ss5), offset: Offset32(0) }, None): num::ParseIntError
@000a                               v20 = stack_load.i8 ss5
@000a                               stack_store v20, ss7
; 
; _9 = const <num::ParseIntError as convert::From<num::ParseIntError>>::from(move _10)
@000a                               v21 = stack_load.i8 ss7
@000a                               v22 = call fn4(v21)
; write_cvalue: Addr(Pointer { base: Stack(ss6), offset: Offset32(0) }, None): num::ParseIntError <- ByVal(v22): num::ParseIntError
@000a                               stack_store v22, ss6
@000a                               jump block7

                                block7:
@000a                               nop 
; 
; _0 = const <result::Result<num::NonZeroU128, num::ParseIntError> as ops::r#try::Try>::from_error(move _9)
@000a                               v23 = stack_load.i8 ss6
@000a                               call fn5(v0, v23)
@000a                               jump block8

                                block8:
@000a                               nop 
; 
; goto
@000e                               return

                                block9:
@000e                               nop 
@000f                               v24 = global_value.i64 gv1
; write_cvalue: Addr(Pointer { base: Stack(ss8), offset: Offset32(0) }, None): num::ParseIntError <- ByRef(Pointer { base: Addr(v24), offset: Offset32(0) }, None): num::ParseIntError
@000f                               v25 = load.i8 v24
@000f                               stack_store v25, ss8
; 
; _0 = const option::Option::<num::NonZeroU128>::ok_or::<num::ParseIntError>(move _2, move _12)
@0010                               v26 = stack_addr.i64 ss1
@0010                               v27 = load.i128 v26
@0010                               v28 = stack_load.i8 ss8
@0010                               call fn6(v0, v27, v28)
@0010                               jump block10

                                block10:
@0010                               nop 
; 
; goto
@000e                               return

                                block11:
@000e                               nop 
; 
; return
@000e                               return
}

Backtrace (for release build)

#0  0x00005555557f5efb in cranelift_codegen::ir::layout::Layout::renumber_insts ()
#1  0x00005555557f5719 in cranelift_codegen::ir::layout::Layout::assign_inst_seq ()
#2  0x000055555578eb39 in <&mut cranelift_codegen::cursor::FuncCursor as cranelift_codegen::ir::builder::InstInserterBase>::insert_built_inst ()
#3  0x000055555579b468 in cranelift_codegen::ir::builder::InstBuilder::stack_addr ()
#4  0x000055555574d70a in cranelift_codegen::legalizer::boundary::handle_call_abi ()
#5  0x000055555585cbaa in cranelift_codegen::legalizer::legalize_inst ()
#6  0x000055555585d874 in cranelift_codegen::legalizer::legalize_function ()
#7  0x000055555578c313 in cranelift_codegen::context::Context::legalize ()
#8  0x000055555578b0e5 in cranelift_codegen::context::Context::compile ()
#9  0x000055555578aabb in cranelift_codegen::context::Context::compile_and_emit ()
[...]

closed time in 6 days

bjorn3

issue commentbytecodealliance/wasmtime

Cranelift: Infinite loop inside of Layout::renumber_insts

This seems to have been caused by a problem in #1510 that is now fixed.

bjorn3

comment created time in 6 days

more