Fix various warnings seen when using gcc-5.0

Alan Modra amodra@gmail.com
Mon Sep 22 09:30:00 GMT 2014


	* config/tc-m68k.c (md_assemble): Add assert to work around
	bogus trunk gcc warning.
	* config/tc-pj.h (md_convert_frag): Warning fix.
	* config/tc-xtensa.c (xg_assemble_vliw_tokens): Warning fix.

diff --git a/gas/config/tc-m68k.c b/gas/config/tc-m68k.c
index 56db083..7fc4efe 100644
--- a/gas/config/tc-m68k.c
+++ b/gas/config/tc-m68k.c
@@ -4511,7 +4511,8 @@ md_assemble (char *str)
 		       (relax_substateT) (the_ins.fragb[n].fragty),
 		       the_ins.fragb[n].fadd, the_ins.fragb[n].foff, to_beg_P);
     }
-  n = (the_ins.numo - the_ins.fragb[n - 1].fragoff);
+  gas_assert (the_ins.nfrag >= 1);
+  n = the_ins.numo - the_ins.fragb[the_ins.nfrag - 1].fragoff;
   shorts_this_frag = 0;
   if (n)
     {
diff --git a/gas/config/tc-pj.h b/gas/config/tc-pj.h
index eda1792..61cd11f 100644
--- a/gas/config/tc-pj.h
+++ b/gas/config/tc-pj.h
@@ -36,7 +36,7 @@ void pj_cons_fix_new_pj (struct frag *, int, int, expressionS *,
 arelent *tc_gen_reloc (asection *, struct fix *);
 
 #define md_section_align(SEGMENT, SIZE)     (SIZE)
-#define md_convert_frag(B, S, F)            (as_fatal (_("convert_frag\n")), 0)
+#define md_convert_frag(B, S, F)            as_fatal (_("convert_frag\n"))
 #define md_estimate_size_before_relax(A, B) (as_fatal (_("estimate size\n")),0)
 #define md_undefined_symbol(NAME)           0
 
diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c
index 7547c0a0..d11b0c7 100644
--- a/gas/config/tc-xtensa.c
+++ b/gas/config/tc-xtensa.c
@@ -6963,7 +6963,7 @@ xg_assemble_vliw_tokens (vliw_insn *vinsn)
   if (frag_now_fix () != 0
       && (! frag_now->tc_frag_data.is_insn
  	  || (vinsn_has_specific_opcodes (vinsn) && use_transform ())
- 	  || !use_transform () != frag_now->tc_frag_data.is_no_transform
+ 	  || (!use_transform ()) != frag_now->tc_frag_data.is_no_transform
  	  || (directive_state[directive_longcalls]
 	      != frag_now->tc_frag_data.use_longcalls)
  	  || (directive_state[directive_absolute_literals]

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list