This is the mail archive of the binutils@sources.redhat.com 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]

Re: [PATCH]: Fix compile time warning building ARM port of GAS


Nick Clifton <nickc@redhat.com> writes:

> Hi Guys,
>
>   I am applying the patch below to fix a compile time warning message
>   which was preventing the ARM port of GAS being built.  The warning
>   message was:
>
>     .../gas/config/tc-arm.c:8445: warning:
>       the address of `do_t_it', will always evaluate as `true'
>
>   (There were lots of duplicates of this message for different lines
>   in the tc-arm.c source file).  This was from a 3.4 based version of
>   GCC.
>
>   The problem was because of macros like this:
>
>     #define TUE(mnem, op, top, nops, ops, ae, te)			\
>     { #mnem, OPS##nops ops, OT_unconditional, 0x##op, 0x##top, ARM_VARIANT, \
>       do_##te ? THUMB_VARIANT : 0, do_##ae, do_##te }
>
>   where the "do_##te ? THUMB_VARIANT : 0" always evaluates to
>   THUMB_VARIANT since do_##te must always exist - it is used to
>   initialise the last field in the structure being set up by the
>   macro.  Hence the patch just removes the redundant tests.

Sorry, that's not a redundant test.  Look farther down the file, each
of the Txx macros has a corresponding non-T macro, that invokes the T
macro with 0 for the 'te' argument.  Since md_assemble uses the
tvariant field to decide whether it's got an encoding function to
call, this patch will cause the assembler to crash on, e.g.

      .text
      .syntax unified
      .thumb
      rsc       r0, r0, r0

I can work with you to find another solution, but I'm not seeing these
warnings.  What compiler are you using?

zw


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