about summary refs log tree commit diff
path: root/src/librustc_codegen_ssa/mir
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-06-12 00:05:19 +0200
committerGitHub <noreply@github.com>2020-06-12 00:05:19 +0200
commit2e42476267011bd8937dfcc0f707aa08e34d54d9 (patch)
tree088ec42bbadf9700638a9283effbcf9cfc05c923 /src/librustc_codegen_ssa/mir
parenta37c32e2d5fb186627ffe99a391c7fd6fd159334 (diff)
parent74befd955bfe23418369064888dc0f08f59c024f (diff)
downloadrust-2e42476267011bd8937dfcc0f707aa08e34d54d9.tar.gz
rust-2e42476267011bd8937dfcc0f707aa08e34d54d9.zip
Rollup merge of #73033 - Amanieu:asm-tls, r=oli-obk
Fix #[thread_local] statics as asm! sym operands

The `asm!` RFC specifies that `#[thread_local]` statics may be used as `sym` operands for inline assembly.

This also fixes a regression in the handling of `#[thread_local]` during monomorphization which caused link-time errors with multiple codegen units, most likely introduced by #71192.

r? @oli-obk
Diffstat (limited to 'src/librustc_codegen_ssa/mir')
-rw-r--r--src/librustc_codegen_ssa/mir/block.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/librustc_codegen_ssa/mir/block.rs b/src/librustc_codegen_ssa/mir/block.rs
index 74d7fc16215..ef59ad486ee 100644
--- a/src/librustc_codegen_ssa/mir/block.rs
+++ b/src/librustc_codegen_ssa/mir/block.rs
@@ -927,12 +927,8 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
                         span_bug!(span, "invalid type for asm sym (fn)");
                     }
                 }
-                mir::InlineAsmOperand::SymStatic { ref value } => {
-                    if let Some(def_id) = value.check_static_ptr(bx.tcx()) {
-                        InlineAsmOperandRef::SymStatic { def_id }
-                    } else {
-                        span_bug!(span, "invalid type for asm sym (static)");
-                    }
+                mir::InlineAsmOperand::SymStatic { def_id } => {
+                    InlineAsmOperandRef::SymStatic { def_id }
                 }
             })
             .collect();