Fix unused warning for address-taken functions
authorRobert Pengelly <robertapengelly@hotmail.com>
Thu, 17 Sep 2026 04:05:11 +0000 (05:05 +0100)
committerRobert Pengelly <robertapengelly@hotmail.com>
Thu, 17 Sep 2026 04:05:11 +0000 (05:05 +0100)
amd64.c
i386.c

diff --git a/amd64.c b/amd64.c
index b359810bf3fe07bd138eb197aa4e4bc74ee2e185..07b99d4ec7cb12a238a2b4b6003cc2cf446a34cc 100644 (file)
--- a/amd64.c
+++ b/amd64.c
@@ -20469,9 +20469,12 @@ static void emit_load_assignment_rhs_to_reg (const char *reg) {
         
         if (find_global_symbol (name) >= 0) {
         
-            emit_load_address_to_reg_now (reg, name);
+            int global_index = find_global_symbol (name);
+            global_symbols[global_index].used = 1;
             
+            emit_load_address_to_reg_now (reg, name);
             free (name);
+            
             return;
         
         }
diff --git a/i386.c b/i386.c
index 39b62fc55baf712170f5a98bdd139bc7d16d6d84..cdcb61f4edd88fb96b4558a4bdd40069a3d44328 100644 (file)
--- a/i386.c
+++ b/i386.c
@@ -19127,9 +19127,12 @@ static void emit_load_assignment_rhs_to_reg (const char *reg) {
         
         if (find_global_symbol (name) >= 0) {
         
-            emit_load_address_to_reg_now (reg, name);
+            int global_index = find_global_symbol (name);
+            global_symbols[global_index].used = 1;
             
+            emit_load_address_to_reg_now (reg, name);
             free (name);
+            
             return;
         
         }