tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] PATCH: In gen_vla_sp_restore, use X30 rather than get_reg


From: Edmund Grimley Evans
Subject: [Tinycc-devel] PATCH: In gen_vla_sp_restore, use X30 rather than get_reg.
Date: Sun, 9 Oct 2016 23:51:11 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

Does this patch look all right?

    In gen_vla_sp_restore, use X30 rather than get_reg.

diff --git a/arm64-gen.c b/arm64-gen.c
index 8276451..f9f9581 100644
--- a/arm64-gen.c
+++ b/arm64-gen.c
@@ -1826,7 +1826,10 @@ ST_FUNC void gen_vla_sp_save(int addr) {
 }
 
 ST_FUNC void gen_vla_sp_restore(int addr) {
-    uint32_t r = intr(get_reg(RC_INT));
+    // Use x30 because this function can be called when there
+    // is a live return value in x0 but there is nothing on
+    // the value stack to prevent get_reg from returning x0.
+    uint32_t r = 30;
     arm64_ldrx(0, 3, r, 29, addr);
     o(0x9100001f | r << 5); // mov sp,x(r)
 }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]