public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH][buildrobot] vax: Fix unused variable warning
@ 2014-01-15 16:07 Jan-Benedict Glaw
  2014-01-19 12:04 ` Gerald Pfeifer
  0 siblings, 1 reply; 2+ messages in thread
From: Jan-Benedict Glaw @ 2014-01-15 16:07 UTC (permalink / raw)
  To: gcc-patches; +Cc: Matt Thomas

[-- Attachment #1: Type: text/plain, Size: 2166 bytes --]

Hi!

Since started, the VAX backend doesn't compile with config-list.mk
because one of VAX's macros doesn't use its argument:

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 -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 loop-invariant.o -MT loop-invariant.o -MMD -MP -MF ./.deps/loop-invariant.TPo ../../../gcc/gcc/loop-invariant.c
../../../gcc/gcc/loop-invariant.c: In function ‘bool check_dependency(basic_block, df_ref, bitmap)’:
../../../gcc/gcc/loop-invariant.c:789:20: error: unused variable ‘regno’ [-Werror=unused-variable]
       unsigned int regno = DF_REF_REGNO (use);
                    ^
cc1plus: all warnings being treated as errors
make[2]: *** [loop-invariant.o] Error 1


This should fix it:


2014-01-15  Jan-Benedict Glaw  <jbglaw@lug-owl.de>

	* config/vax/vax.h (FUNCTION_ARG_REGNO_P): Vix unused variable warning.

--- a/gcc/config/vax/vax.h
+++ b/gcc/config/vax/vax.h
@@ -295,7 +295,7 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES };
 /* 1 if N is a possible register number for function argument passing.
    On the VAX, no registers are used in this way.  */
 
-#define FUNCTION_ARG_REGNO_P(N) 0
+#define FUNCTION_ARG_REGNO_P(N) ((void) (N), 0)
 \f
 /* Define a data type for recording info about an argument list
    during the scan of that argument list.  This data type should


-- 
      Jan-Benedict Glaw      jbglaw@lug-owl.de              +49-172-7608481
Signature of: "Debugging is twice as hard as writing the code in the first place.
the second  :  Therefore, if you write the code as cleverly as possible, you are,
               by definition, not smart enough to debug it." - Brian W. Kernighan

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH][buildrobot] vax: Fix unused variable warning
  2014-01-15 16:07 [PATCH][buildrobot] vax: Fix unused variable warning Jan-Benedict Glaw
@ 2014-01-19 12:04 ` Gerald Pfeifer
  0 siblings, 0 replies; 2+ messages in thread
From: Gerald Pfeifer @ 2014-01-19 12:04 UTC (permalink / raw)
  To: Jan-Benedict Glaw, gcc-patches; +Cc: Matt Thomas

Jan-Benedict Glaw wrote
>	* config/vax/vax.h (FUNCTION_ARG_REGNO_P): Vix unused variable
>warning.

Fix? ;-)

And if it's been broken for a while, just go ahead and commit the fix.

Gerald

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-01-19 12:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-15 16:07 [PATCH][buildrobot] vax: Fix unused variable warning Jan-Benedict Glaw
2014-01-19 12:04 ` Gerald Pfeifer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).