Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
ab7f02d
add documentation from doc(include) to analysis data
QuietMisdreavus Jan 16, 2018
6c86da2
Make wording around 0-cost casts more precise
tbu- Jan 27, 2018
f641ac6
Add regression test for #44415
Jan 24, 2018
5a350c1
add doc(include) to the save-analysis test
QuietMisdreavus Jan 31, 2018
c22d6e2
Fix rustdoc ICE on macros defined within functions
Manishearth Feb 2, 2018
ee737c7
Add regression test
Manishearth Feb 2, 2018
3d114c7
Remove delay_span_bug() in check_aliasability
topecongiro Feb 4, 2018
f243f92
Fix info about generic impls in AsMut docs
mbrubeck Feb 4, 2018
dcb3e21
update trpl
steveklabnik Jan 25, 2018
b320829
update reference
steveklabnik Jan 26, 2018
5437188
update mdbook to 0.1.2
steveklabnik Jan 25, 2018
983cc00
add exceptions for new deps
steveklabnik Feb 3, 2018
3c72a84
save-analysis: avoid implicit unwrap
nrc Feb 4, 2018
01f0814
Stabilize use_nested_groups
pietroalbini Feb 1, 2018
a29d854
Make inline assembly volatile if it has no outputs. Fixes #46026
Zoxc Nov 16, 2017
eb5a461
Rollup merge of #46030 - Zoxc:asm-volatile, r=nikomatsakis
kennytm Feb 5, 2018
cde119d
Rollup merge of #47496 - QuietMisdreavus:rls-doc-include, r=estebank
kennytm Feb 5, 2018
9dab737
Rollup merge of #47543 - topecongiro:issue-42344, r=nikomatsakis
kennytm Feb 5, 2018
a405a08
Rollup merge of #47704 - dsprenkels:issue-44415, r=alexcrichton
kennytm Feb 5, 2018
ddc4284
Rollup merge of #47753 - steveklabnik:update-book, r=alexcrichton
kennytm Feb 5, 2018
e8688b4
Rollup merge of #47807 - tbu-:pr_doc_constanttime_cstr, r=steveklabnik
kennytm Feb 5, 2018
55aef3c
Rollup merge of #47948 - pietroalbini:use-nested-groups-stabilize, r=…
kennytm Feb 5, 2018
daecd15
Rollup merge of #47959 - Manishearth:rustdoc-ice, r=Mark-Simulacrum
kennytm Feb 5, 2018
e2f6e13
Rollup merge of #48003 - mbrubeck:docs, r=steveklabnik
kennytm Feb 5, 2018
0553dc8
Rollup merge of #48007 - nrc:rls-field-init, r=eddyb
kennytm Feb 5, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make inline assembly volatile if it has no outputs. Fixes #46026
  • Loading branch information
Zoxc committed Feb 5, 2018
commit a29d8545b573d008e364571a83fcd865748a8ad8
6 changes: 6 additions & 0 deletions src/libsyntax_ext/asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,12 @@ pub fn expand_asm<'cx>(cx: &'cx mut ExtCtxt,
}
}

// If there are no outputs, the inline assembly is executed just for its side effects,
// so ensure that it is volatile
if outputs.is_empty() {
volatile = true;
}

MacEager::expr(P(ast::Expr {
id: ast::DUMMY_NODE_ID,
node: ast::ExprKind::InlineAsm(P(ast::InlineAsm {
Expand Down
26 changes: 26 additions & 0 deletions src/test/codegen/no-output-asm-is-volatile.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// compile-flags: -O

// ignore-asmjs

#![feature(asm)]
#![crate_type = "lib"]

// Check that inline assembly expressions without any outputs
// are marked as having side effects / being volatile

// CHECK-LABEL: @assembly
#[no_mangle]
pub fn assembly() {
unsafe { asm!("") }
// CHECK: tail call void asm sideeffect "", {{.*}}
}