public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] msp430: Mark unused attribute
@ 2022-09-06  7:57 Jan-Benedict Glaw
  2022-09-06  8:59 ` Richard Biener
  2022-09-06 11:44 ` Nick Clifton
  0 siblings, 2 replies; 3+ messages in thread
From: Jan-Benedict Glaw @ 2022-09-06  7:57 UTC (permalink / raw)
  To: Nick Clifton; +Cc: gcc-patches

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

Hi Nick!

This patch fixes a small warning in the msp430 backend (tested for
--target=msp430-elf and --target=msp430-elfbare).

.../gcc/configure --prefix=... --enable-werror-always --enable-languages=all --disable-gcov --disable-shared --disable-threads --target=msp430-elf --without-headers
[...]
make V=1 all-gcc
[...]
/usr/lib/gcc-snapshot/bin/g++  -fno-PIE -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../../gcc/gcc/../libcody  -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I../../gcc/gcc/../libbacktrace   -o msp430.o -MT msp430.o -MMD -MP -MF ./.deps/msp430.TPo ../../gcc/gcc/config/msp430/msp430.cc
../../gcc/gcc/config/msp430/msp430.cc: In function 'int msp430_single_op_cost(rtx, bool, rtx)':
../../gcc/gcc/config/msp430/msp430.cc:1463:49: error: unused parameter 'outer_rtx' [-Werror=unused-parameter]
 1463 | msp430_single_op_cost (rtx dst, bool speed, rtx outer_rtx)
      |                                             ~~~~^~~~~~~~~
cc1plus: all warnings being treated as errors
make[1]: *** [Makefile:2440: msp430.o] Error 1
make[1]: Leaving directory '/var/lib/laminar/run/gcc-msp430-elf/1/toolchain-build/gcc'
make: *** [Makefile:4584: all-gcc] Error 2



2022-09-06  Jan-Benedict Glaw  <jbglaw@lug-owl.de>

gcc/ChangeLog:
	* config/msp430/msp430.cc (msp430_single_op_cost): Mark unused argument.

diff --git a/gcc/config/msp430/msp430.cc b/gcc/config/msp430/msp430.cc
index 7a378ceac56..2909cabd3ff 100644
--- a/gcc/config/msp430/msp430.cc
+++ b/gcc/config/msp430/msp430.cc
@@ -1460,7 +1460,7 @@ msp430_get_inner_dest_code (rtx x)
 /* Calculate the cost of an MSP430 single-operand instruction, for operand DST
    within the RTX OUTER_RTX, optimizing for speed if SPEED is true.  */
 static int
-msp430_single_op_cost (rtx dst, bool speed, rtx outer_rtx)
+msp430_single_op_cost (rtx dst, bool speed, rtx outer_rtx ATTRIBUTE_UNUSED)
 {
   enum rtx_code dst_code = GET_CODE (dst);
   const struct single_op_cost *cost_p;



Okay for HEAD?

Thanks,
  Jan-Benedict

-- 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

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

* Re: [PATCH] msp430: Mark unused attribute
  2022-09-06  7:57 [PATCH] msp430: Mark unused attribute Jan-Benedict Glaw
@ 2022-09-06  8:59 ` Richard Biener
  2022-09-06 11:44 ` Nick Clifton
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Biener @ 2022-09-06  8:59 UTC (permalink / raw)
  To: Jan-Benedict Glaw; +Cc: Nick Clifton, GCC Patches

On Tue, Sep 6, 2022 at 9:57 AM Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:
>
> Hi Nick!
>
> This patch fixes a small warning in the msp430 backend (tested for
> --target=msp430-elf and --target=msp430-elfbare).
>
> .../gcc/configure --prefix=... --enable-werror-always --enable-languages=all --disable-gcov --disable-shared --disable-threads --target=msp430-elf --without-headers
> [...]
> make V=1 all-gcc
> [...]
> /usr/lib/gcc-snapshot/bin/g++  -fno-PIE -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../../gcc/gcc/../libcody  -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I../../gcc/gcc/../libbacktrace   -o msp430.o -MT msp430.o -MMD -MP -MF ./.deps/msp430.TPo ../../gcc/gcc/config/msp430/msp430.cc
> ../../gcc/gcc/config/msp430/msp430.cc: In function 'int msp430_single_op_cost(rtx, bool, rtx)':
> ../../gcc/gcc/config/msp430/msp430.cc:1463:49: error: unused parameter 'outer_rtx' [-Werror=unused-parameter]
>  1463 | msp430_single_op_cost (rtx dst, bool speed, rtx outer_rtx)
>       |                                             ~~~~^~~~~~~~~
> cc1plus: all warnings being treated as errors
> make[1]: *** [Makefile:2440: msp430.o] Error 1
> make[1]: Leaving directory '/var/lib/laminar/run/gcc-msp430-elf/1/toolchain-build/gcc'
> make: *** [Makefile:4584: all-gcc] Error 2
>
>
>
> 2022-09-06  Jan-Benedict Glaw  <jbglaw@lug-owl.de>
>
> gcc/ChangeLog:
>         * config/msp430/msp430.cc (msp430_single_op_cost): Mark unused argument.
>
> diff --git a/gcc/config/msp430/msp430.cc b/gcc/config/msp430/msp430.cc
> index 7a378ceac56..2909cabd3ff 100644
> --- a/gcc/config/msp430/msp430.cc
> +++ b/gcc/config/msp430/msp430.cc
> @@ -1460,7 +1460,7 @@ msp430_get_inner_dest_code (rtx x)
>  /* Calculate the cost of an MSP430 single-operand instruction, for operand DST
>     within the RTX OUTER_RTX, optimizing for speed if SPEED is true.  */
>  static int
> -msp430_single_op_cost (rtx dst, bool speed, rtx outer_rtx)
> +msp430_single_op_cost (rtx dst, bool speed, rtx outer_rtx ATTRIBUTE_UNUSED)

You can just drop the argument identifier since we're C++ now.  Or use
rtx /* outer_rtx */
for documentation purposes.

OK with that change.

Richard.

>  {
>    enum rtx_code dst_code = GET_CODE (dst);
>    const struct single_op_cost *cost_p;
>
>
>
> Okay for HEAD?
>
> Thanks,
>   Jan-Benedict
>
> --

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

* Re: [PATCH] msp430: Mark unused attribute
  2022-09-06  7:57 [PATCH] msp430: Mark unused attribute Jan-Benedict Glaw
  2022-09-06  8:59 ` Richard Biener
@ 2022-09-06 11:44 ` Nick Clifton
  1 sibling, 0 replies; 3+ messages in thread
From: Nick Clifton @ 2022-09-06 11:44 UTC (permalink / raw)
  To: Jan-Benedict Glaw; +Cc: gcc-patches

Hi Jan-Benedict,

> gcc/ChangeLog:
> 	* config/msp430/msp430.cc (msp430_single_op_cost): Mark unused argument.

> Okay for HEAD?

Patch approved - please apply.   (I think that this patch would also count as
an "obvious" fix, but thanks for asking anyway).

Cheers
   Nick



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

end of thread, other threads:[~2022-09-06 11:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-06  7:57 [PATCH] msp430: Mark unused attribute Jan-Benedict Glaw
2022-09-06  8:59 ` Richard Biener
2022-09-06 11:44 ` Nick Clifton

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).