Cranelift aarch64: `enable_compact_unwind_abi` + `enable_pinned_reg` clobbers the pinned register in epilogues

Abierto
#15,378 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
rust
Área
compilers

Línea de trabajo

Start with the precise-output test in the issue and trace add_macho_compact_unwind_paired_regs and how it updates the clobber set for AArch64. Check the compact unwind and pinned register handling together, then add or update a regression test showing the pinned register survives the epilogue; done when the epilogue no longer restores over the pinned register.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug cranelift cranelift:area:aarch64

This test

test compile precise-output
set enable_compact_unwind_abi=true
set enable_pinned_reg=true
target aarch64

function %f(i64, i64, i64, i64) -> i64 apple_aarch64 {
    fn0 = colocated %callee() apple_aarch64

block0(v0: i64, v1: i64, v2: i64, v3: i64):
    call fn0()
    set_pinned_reg v3
    v5 = iadd v0, v1
    v6 = iadd v5, v2
    return v6
}

shows:

  stp x29, x30, [sp, #-0x10]!
  mov x29, sp
  stp x20, x19, [sp, #-0x10]!
  stp x22, x21, [sp, #-0x10]!      ; x21 saved
  stp x24, x23, [sp, #-0x10]!
  ...
  bl #0x24 ; reloc_external Call %callee 0
  mov x3, x23
  mov x21, x3                      ; set_pinned_reg v3
  ...
  ldp x24, x23, [sp], #0x10
  ldp x22, x21, [sp], #0x10        ; x21 overwritten with its entry value
  ldp x20, x19, [sp], #0x10
  ldp x29, x30, [sp], #0x10
  ret

The add_macho_compact_unwind_paired_regs ends up adding x21 to the clobber set which causes this which isn't correct when the pinned register is enabled.

Lenguaje dominante
Rust
Estrellas
18.9k
Forks
2k
Merge medio
1 d 6 h
PR fusionados (30 d)
238

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de bytecodealliance/wasmtime

Todos los issues de bytecodealliance/wasmtime

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.