This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] ARM/gas: Fix a build failure with GCC 4.3.3


 The change below fixes a GAS build failure with GCC 4.3.3 for ARM 

cc1: warnings being treated as errors
.../gas/config/tc-arm.c: In function 'add_to_lit_pool':
.../gas/config/tc-arm.c:3193: error: 'imm1' may be used uninitialized in this function

The variable is only initialised in a conditional block and while some 
versions of GCC may be smart enough to see that the variable is only later 
read under the same conditions other versions may not be as smart.

 Verified to remove the problem with arm-aout, arm-coff, arm-epoc-pe, 
arm-linuxeabi, arm-netbsdelf, arm-nto, arm-pe, arm-symbianelf, arm-vxworks 
and arm-wince-pe.  OK to apply?

2014-08-20  Maciej W. Rozycki  <>

	* config/tc-arm.c (add_to_lit_pool): Preinitialize `imm1'.


Index: binutils-fsf-trunk-quilt/gas/config/tc-arm.c
--- binutils-fsf-trunk-quilt.orig/gas/config/tc-arm.c	2014-07-31 02:40:59.000000000 +0100
+++ binutils-fsf-trunk-quilt/gas/config/tc-arm.c	2014-08-20 21:40:04.137795341 +0100
@@ -3190,7 +3190,7 @@ add_to_lit_pool (unsigned int nbytes)
   literal_pool * pool;
   unsigned int entry, pool_size = 0;
   bfd_boolean padding_slot_p = FALSE;
-  unsigned imm1;
+  unsigned imm1 = 0;
   unsigned imm2 = 0;
   if (nbytes == 8)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]