Do not simultaneously clobber registers passed into assembly.

This is not actually legal (although the restriction is not
documented anywhere), and is not caught by LLVM unless the codegen
option -verify-machineinstrs is specified. This option is now used
on Travis.

While not legal, this does not seem to result in invalid output
(although it creates an unnecessary spill); however, under extremely
specific circumstances (e.g. when a register scavenger is run under
severe pressure), this will result in a codegen crash, which is
how I found it.
This commit is contained in:
whitequark 2016-08-30 10:45:39 +00:00 committed by edef
parent e02ef03304
commit 2d8cefcabc
4 changed files with 5 additions and 5 deletions

View File

@ -4,7 +4,7 @@ sudo: false
install: install:
- .travis/docs/install - .travis/docs/install
script: script:
- cargo build --verbose - cargo rustc --verbose -- -C llvm-args=-verify-machineinstrs
- cargo test --verbose - cargo test --verbose
- cargo bench --verbose - cargo bench --verbose
- cargo doc - cargo doc

View File

@ -156,7 +156,7 @@ pub unsafe fn swap(arg: usize, old_sp: &mut StackPointer, new_sp: &StackPointer,
"{r4}" (old_sp) "{r4}" (old_sp)
"{r5}" (new_sp) "{r5}" (new_sp)
"{r6}" (new_cfa) "{r6}" (new_cfa)
: "r3", "r4", "r5", "r6", "r7", :/*"r0", "r1", "r2", "r3", "r4", "r5", "r6",*/"r7",
"r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
"r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
"r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31", "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31",

View File

@ -151,7 +151,7 @@ pub unsafe fn swap(arg: usize, old_sp: &mut StackPointer, new_sp: &StackPointer,
"{esi}" (old_sp) "{esi}" (old_sp)
"{edx}" (new_sp) "{edx}" (new_sp)
"{edi}" (new_cfa) "{edi}" (new_cfa)
: "eax", "ebx", "ecx", "edx", "esi", "edi", //"ebp", "esp", :/*"eax",*/"ebx", "ecx",/*"edx", "esi", "edi", "ebp", "esp",*/
"mmx0", "mmx1", "mmx2", "mmx3", "mmx4", "mmx5", "mmx6", "mmx7", "mmx0", "mmx1", "mmx2", "mmx3", "mmx4", "mmx5", "mmx6", "mmx7",
"xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7",
"cc", "fpsr", "flags", "memory" "cc", "fpsr", "flags", "memory"

View File

@ -153,7 +153,7 @@ pub unsafe fn swap(arg: usize, old_sp: &mut StackPointer, new_sp: &StackPointer,
"{rsi}" (old_sp) "{rsi}" (old_sp)
"{rdx}" (new_sp) "{rdx}" (new_sp)
"{rcx}" (new_cfa) "{rcx}" (new_cfa)
: "rax", "rbx", "rcx", "rdx", "rsi", "rdi", //"rbp", "rsp", : "rax", "rbx", /*"rcx", "rdx", "rsi", "rdi", "rbp", "rsp",*/
"r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
"xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7",
"xmm8", "xmm9", "xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15", "xmm8", "xmm9", "xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15",