This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [BUILDROBOT] [PATCH] rx-elf: error: logical not is only applied to the left hand side of comparison


On Thu, Sep 4, 2014 at 10:48 AM, Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:
> Hi!
>
> -Wlogical-not-parentheses was enabled recently via -Wall, and it
> triggered for rx-elf
> (http://toolchain.lug-owl.de/buildbot/show_build_details.php?id=350506)
> on a build with config-list.mk, where a GCC of the same revision is
> used:
>
> g++ -c   -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common  -DHAVE_CONFIG_H -I. -I. -I../../../gcc/gcc -I../../../gcc/gcc/. -I../../../gcc/gcc/../include -I../../../gcc/gcc/../libcpp/include -I/opt/cfarm/mpc/include  -I../../../gcc/gcc/../libdecnumber -I../../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I../../../gcc/gcc/../libbacktrace    -o caller-save.o -MT caller-save.o -MMD -MP -MF ./.deps/caller-save.TPo ../../../gcc/gcc/caller-save.c
> In file included from ./tm.h:18:0,
>                  from ../../../gcc/gcc/caller-save.c:23:
> ../../../gcc/gcc/caller-save.c: In function âint reg_save_code(int, machine_mode)â:
> ../../../gcc/gcc/config/rx/rx.h:338:27: error: logical not is only applied to the left hand side of comparison [-Werror=logical-not-parentheses]
>    REGNO_REG_CLASS (REGNO) == GR_REGS
>                            ^
> ../../../gcc/gcc/caller-save.c:116:8: note: in expansion of macro âHARD_REGNO_MODE_OKâ
>    if (!HARD_REGNO_MODE_OK (reg, mode))
>         ^
> cc1plus: all warnings being treated as errors
> make[2]: *** [caller-save.o] Error 1
>
>
>
> This should fix it:
>
> 2014-09-04  Jan-Benedict Glaw  <jbglaw@lug-owl.de>
>
>         * config/rx/rx.h (HARD_REGNO_MODE_OK): Add braces.
>
>
> diff --git a/gcc/config/rx/rx.h b/gcc/config/rx/rx.h
> index 8f3d92b..64d96d1 100644
> --- a/gcc/config/rx/rx.h
> +++ b/gcc/config/rx/rx.h
> @@ -334,8 +334,8 @@ typedef unsigned int CUMULATIVE_ARGS;
>
>  #define HARD_REGNO_NREGS(REGNO, MODE)   CLASS_MAX_NREGS (0, MODE)
>
> -#define HARD_REGNO_MODE_OK(REGNO, MODE)                        \
> -  REGNO_REG_CLASS (REGNO) == GR_REGS
> +#define HARD_REGNO_MODE_OK(REGNO, MODE)                                \
> +  (REGNO_REG_CLASS (REGNO) == GR_REGS)
>
>  #define MODES_TIEABLE_P(MODE1, MODE2)                          \
>    (   (   GET_MODE_CLASS (MODE1) == MODE_FLOAT                 \
>
>
>
> Ok to commit?

Ok (counts as obvious).

Richard.

> MfG, JBG
>
> --
>       Jan-Benedict Glaw      jbglaw@lug-owl.de              +49-172-7608481
> Signature of:       Warum ist ScheiÃe braun? ...weil braun schon immer scheiÃe ist!
> the second  :


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