error when building with LTO

Alan Modra amodra@gmail.com
Sun Sep 30 02:45:00 GMT 2012


On Sat, Sep 29, 2012 at 03:13:42PM +0400, niXman wrote:
> binutils-2.22.90/gas/write.c: In function 'chain_frchains_together':
> binutils-2.22.90/gas/write.c:409:3: error: 'dummy.fr_type' may be used
> uninitialized in this function [-Werror=uninitialized]
> In file included from binutils-2.22.90/bfd/../include/coff/internal.h:541:0,
>                  from :631:

Does this cure the warning?

Index: gas/write.c
===================================================================
RCS file: /cvs/src/src/gas/write.c,v
retrieving revision 1.151
diff -u -p -r1.151 write.c
--- gas/write.c	2 Jul 2012 07:35:06 -0000	1.151
+++ gas/write.c	30 Sep 2012 02:42:58 -0000
@@ -406,8 +406,8 @@ chain_frchains_together_1 (segT section,
 	  prev_fix = frchp->fix_tail;
 	}
     }
-  gas_assert (prev_frag->fr_type != 0);
-  gas_assert (prev_frag != &dummy);
+  gas_assert (prev_frag != &dummy
+	      && prev_frag->fr_type != 0);
   prev_frag->fr_next = 0;
   return prev_frag;
 }

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list