This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] ARM/gas: Fix a build failure with GCC 4.3.3
- From: "Maciej W. Rozycki" <macro at codesourcery dot com>
- To: <binutils at sourceware dot org>
- Cc: Nick Clifton <nickc at redhat dot com>, Richard Earnshaw <rearnsha at arm dot com>
- Date: Thu, 21 Aug 2014 00:56:05 +0100
- Subject: [PATCH] ARM/gas: Fix a build failure with GCC 4.3.3
- Authentication-results: sourceware.org; auth=none
Hi,
The change below fixes a GAS build failure with GCC 4.3.3 for ARM
targets:
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 <macro@codesourcery.com>
gas/
* config/tc-arm.c (add_to_lit_pool): Preinitialize `imm1'.
Maciej
binutils-gas-arm-add-to-lit-pool-fix.diff
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)