Skip to contentSkip to conversation

[4485] Fix TCG alignment problems on Sparc64 host

Qemu-devel Blue Swirl 2 participants 2 messages May 18, 2008

lore
Share & tools
lore

Blue Swirl

author
#0 lore raw

Revision: 4485

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4485
Author:   blueswir1
Date:     2008-05-18 07:49:05 +0000 (Sun, 18 May 2008)

Log Message:
-----------
Fix TCG alignment problems on Sparc64 host

Modified Paths:
--------------
trunk/tcg/tcg.h

Modified: trunk/tcg/tcg.h
===================================================================

tcg/tcg.h +2 -2
@@ -71,7 +71,7 @@
 } TCGRelocation; 
 
 typedef struct TCGLabel {
-    int has_value;
+    long has_value; // long instead of int to enforce alignment
     union {
         tcg_target_ulong value;
         TCGRelocation *first_reloc;
@@ -80,7 +80,7 @@
 
 typedef struct TCGPool {
     struct TCGPool *next;
-    int size;
+    long size; // long instead of int to enforce alignment
     uint8_t data[0];
 } TCGPool;
 
#1 lore raw

I don't understand why TCGLabel needs further alignment. For TCGPool, the correct fix is either to use the gcc alignment attributes or to change the type of data to long.

Regards,

Fabrice.

Quoted 40 lines · Blue Swirl

Revision: 4485

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4485
Author:   blueswir1
Date:     2008-05-18 07:49:05 +0000 (Sun, 18 May 2008)

Log Message:
-----------
Fix TCG alignment problems on Sparc64 host

Modified Paths:
--------------
trunk/tcg/tcg.h

Modified: trunk/tcg/tcg.h
===================================================================

tcg/tcg.h +2 -2
@@ -71,7 +71,7 @@
 } TCGRelocation; 
 
 typedef struct TCGLabel {
-    int has_value;
+    long has_value; // long instead of int to enforce alignment
     union {
         tcg_target_ulong value;
         TCGRelocation *first_reloc;
@@ -80,7 +80,7 @@
 
 typedef struct TCGPool {
     struct TCGPool *next;
-    int size;
+    long size; // long instead of int to enforce alignment
     uint8_t data[0];
 } TCGPool;