The Microblaze target confuses unsigned long with HOST_WIDE_INT.

This works fine for many architectures, but fails on ARM (HOST_WIDE_INT is 8
bytes, unsigned long is 4 bytes). Leading to print a uninitialized register
instead of the desired number, fix by using the correct printf-specifier.

Tested to fix the issue and work with an ARM->MB cross compiler.

--- a/gcc/config/microblaze/microblaze.h
+++ b/gcc/config/microblaze/microblaze.h
@@ -695,7 +695,7 @@ do {
\
   fprintf (STREAM, "\t.align\t%d\n", (LOG))
 
 #define ASM_OUTPUT_SKIP(STREAM,SIZE)                                   \
-  fprintf (STREAM, "\t.space\t%lu\n", (SIZE))
+  fprintf (STREAM, "\t.space\t" HOST_WIDE_INT_PRINT_DEC "\n", (SIZE))
 
 #define ASCII_DATA_ASM_OP              "\t.ascii\t"
 #define STRING_ASM_OP                  "\t.asciz\t"


Reply via email to