mips: fix a bug when scanning the stack

Previously the assembler was reordering this code:

    jal tinygo_scanstack
    move $a0, $sp

Into this:

    jal tinygo_scanstack
    nop
    move $a0, $sp

So it was "helpfully" inserting a branch delay slot, even though this
was already being taken care of.
Somehow this didn't break, but it does break in the WIP threading branch
(https://github.com/tinygo-org/tinygo/pull/4559) where this bug leads to
a crash.
This commit is contained in:
Ayke van Laethem
2024-12-01 09:32:31 +01:00
committed by Ayke
parent 26c36d0a2e
commit 3b8062170c
2 changed files with 8 additions and 0 deletions
+4
View File
@@ -1,3 +1,7 @@
// Do not reorder instructions to insert a branch delay slot.
// We know what we're doing, and will manually fill the branch delay slot.
.set noreorder
.section .text.tinygo_startTask
.global tinygo_startTask
.type tinygo_startTask, %function
+4
View File
@@ -1,3 +1,7 @@
// Do not reorder instructions to insert a branch delay slot.
// We know what we're doing, and will manually fill the branch delay slot.
.set noreorder
.section .text.tinygo_scanCurrentStack
.global tinygo_scanCurrentStack
.type tinygo_scanCurrentStack, %function