ARM: Use explicit remainder in __mesabi_uldiv call.

This inexplicably fixes a segfault in tcc-boot0.

* module/mescc/armv4/as.scm (armv4:r0/r1): Instead of using "push 0",
use explicit slot for remainder.
This commit is contained in:
Jan (janneke) Nieuwenhuizen 2022-09-13 13:52:03 +02:00
parent 496fd10680
commit 31e5f2e476
1 changed files with 7 additions and 4 deletions

View File

@ -369,10 +369,13 @@
`(,(string-append "push___%" r0)) `(,(string-append "push___%" r0))
(armv4:call-label #f "__mesabi_idiv" 2)) (armv4:call-label #f "__mesabi_idiv" 2))
;; __mesabi_uldiv(a, b, remainderp) ;; __mesabi_uldiv(a, b, remainderp)
(cons* `(,(string-append "push___0")) (append `(("push___%r3") ; slot for remainder
`(,(string-append "push___%" r1)) ("mov____%esp,%r3")
`(,(string-append "push___%" r0)) ("push___%r3") ; pointer to remainder
(armv4:call-label #f "__mesabi_uldiv" 3))))) (,(string-append "push___%" r1))
(,(string-append "push___%" r0)))
(armv4:call-label #f "__mesabi_uldiv" 3)
`(("pop____%r3"))))))
(define (armv4:r0%r1 info signed?) (define (armv4:r0%r1 info signed?)
(let ((r0 (get-r0 info)) (let ((r0 (get-r0 info))