[BUILDROBOT] [PATCH] rx-elf: error: logical not is only applied to the left hand side of comparison

Jan-Benedict Glaw jbglaw@lug-owl.de
Thu Sep 4 08:48:00 GMT 2014


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?

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  :
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20140904/b1f672c2/attachment.sig>


More information about the Gcc-patches mailing list