Skip to content

Commit e848fbc

Browse files
authoredJan 27, 2024
Merge pull request #1442 from RalfJung/asm-terminate
pure asm blocks must terminate
2 parents d4eac74 + 8eda943 commit e848fbc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

Diff for: ‎src/inline-assembly.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ The list of clobbered registers for each ABI is updated in rustc as architecture
412412

413413
Flags are used to further influence the behavior of the inline assembly block.
414414
Currently the following options are defined:
415-
- `pure`: The `asm!` block has no side effects, and its outputs depend only on its direct inputs (i.e. the values themselves, not what they point to) or values read from memory (unless the `nomem` options is also set).
415+
- `pure`: The `asm!` block has no side effects, must eventually return, and its outputs depend only on its direct inputs (i.e. the values themselves, not what they point to) or values read from memory (unless the `nomem` options is also set).
416416
This allows the compiler to execute the `asm!` block fewer times than specified in the program (e.g. by hoisting it out of a loop) or even eliminate it entirely if the outputs are not used.
417417
The `pure` option must be combined with either the `nomem` or `readonly` options, otherwise a compile-time error is emitted.
418418
- `nomem`: The `asm!` blocks does not read or write to any memory.

0 commit comments

Comments
 (0)
Please sign in to comment.