Skip to content

LLVM assertion when using i128 with the NVPTX #38824

Closed
@japaric

Description

@japaric

This effectively means you can't compile core for these targets.

STR

$ edit foo.rs && cat $_
#![crate_type = "lib"]
#![feature(i128_type)]
#![feature(lang_items)]
#![feature(no_core)]
#![no_core]

fn foo() -> i128 { 0 }

#[lang = "copy"]
trait Copy {}

#[lang = "sized"]
trait Sized {}
$ edit nvptx64-nvidia-cuda.json && cat $_
{
  "arch": "nvptx64",
  "cpu": "sm_20",
  "data-layout": "e-i64:64-v16:16-v32:32-n16:32:64",
  "llvm-target": "nvptx64-nvidia-cuda",
  "max-atomic-width": 0,
  "os": "cuda",
  "panic-strategy": "abort",
  "target-endian": "little",
  "target-pointer-width": "64"
}
$ rustc --target nvptx64-nvidia-cuda foo.rs
rustc: /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp:2492: virtual llvm::SDValue llvm::NVPTXTargetLowering::LowerReturn(llvm::SDValue, llvm::CallingConv::ID, bool, const llvm::SmallVectorImpl<llvm::ISD::OutputArg>&, const llvm::SmallVectorImpl<llvm::SDValue>&, const llvm::SDLoc&, llvm::SelectionDAG&) const: Assertion `ValVTs.size() == OutVals.size() && "Bad return value decomposition"' failed.

Meta

$ rustc -V
rustc 1.16.0-nightly (468227129 2017-01-03)

Already Fixed

$ cat msp430.json && cat $_
{
  "arch": "msp430",
  "asm-args": ["-mcpu=msp430"],
  "data-layout": "e-m:e-p:16:16-i32:16:32-a:16-n8:16",
  "executables": true,
  "linker": "msp430-elf-gcc",
  "llvm-target": "msp430",
  "max-atomic-width": 0,
  "no-integrated-as": true,
  "os": "none",
  "panic-strategy": "abort",
  "relocation-model": "static",
  "target-endian": "little",
  "target-pointer-width": "16",
  "vendor": "unknown"
}
$ rustc --target msp430 foo.rs
Return operand #4 has unhandled type i16
UNREACHABLE executed at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/llvm/lib/CodeGen/CallingConvLower.cpp:114!

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.O-NVPTXTarget: the NVPTX LLVM backend for running rust on GPUs, https://llvm.org/docs/NVPTXUsage.html

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions