Skip to content

mergefunc hits asserts on our bytecode #9216

Closed
@thestinger

Description

@thestinger

Compile with rustc --passes mergefunc:

fn foo(_: &fn(uint, uint) -> uint) {}

fn bar() {
    foo(|_, u2| u2);
}

fn baz(x: &~[uint]) -> ~[uint] {
    x.clone()
}

Minimal IR:

target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

define internal i64 @foo(i64, i64) {
  ret i64 %1
}

define internal i64 @bar(i64*, i64) {
  ret i64 %1
}

define internal i64 @use_bar() {
  %1 = alloca i64 (i64*, i64)*
  store i64 (i64*, i64)* @bar, i64 (i64*, i64)** %1
  ret i64 undef
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-slowIssue: Problems and improvements with respect to performance of generated code.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions