From 28a0da39c6db871d66b945d3025f69d56e487aa9 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Mon, 22 Sep 2014 18:09:49 +0930 Subject: [PATCH] Fix various warnings seen when using gcc-5.0 * 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. --- gas/ChangeLog | 7 +++++++ gas/config/tc-m68k.c | 3 ++- gas/config/tc-pj.h | 2 +- gas/config/tc-xtensa.c | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index a01b41e1cd..9d512b6961 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,10 @@ +2014-09-22 Alan Modra + + * 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. + 2014-09-17 Tristan Gingold * config/tc-arm.c (move_or_literal_pool, add_to_lit_pool): Use diff --git a/gas/config/tc-m68k.c b/gas/config/tc-m68k.c index 56db083233..7fc4efeb7b 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 eda1792fb6..61cd11f95e 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 7547c0a03b..d11b0c7f27 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] -- 2.34.1