* [PATCH] Fix multi-statement define for alpha-dec-vms
@ 2021-09-12 18:12 Jan-Benedict Glaw
2021-09-13 9:11 ` Richard Biener
0 siblings, 1 reply; 3+ messages in thread
From: Jan-Benedict Glaw @ 2021-09-12 18:12 UTC (permalink / raw)
To: Douglas Rupp, Tristan Gingold; +Cc: GCC Patches
[-- Attachment #1: Type: text/plain, Size: 4474 bytes --]
Hi!
While mass-building a cross-gcc, I noticed that for
alpha-dec-vms/alpha64-dec-vms, recent GCC versions correctly throw a warning
due to a multi-statement define that gets rippen in an if/else case:
[all 2021-09-12 15:51:55] /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 -Wno-error=format-diag -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 value-prof.o -MT value-prof.o -MMD -MP -MF ./.deps/value-prof.TPo ../../gcc/gcc/value-prof.c
[all 2021-09-12 15:52:01] /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 -Wno-error=format-diag -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 var-tracking.o -MT var-tracking.o -MMD -MP -MF ./.deps/var-tracking.TPo ../../gcc/gcc/var-tracking.c
[all 2021-09-12 15:52:03] In file included from ./tm.h:21,
[all 2021-09-12 15:52:03] from ../../gcc/gcc/backend.h:28,
[all 2021-09-12 15:52:03] from ../../gcc/gcc/var-tracking.c:91:
[all 2021-09-12 15:52:03] ../../gcc/gcc/var-tracking.c: In function 'void prepare_call_arguments(basic_block, rtx_insn*)':
[all 2021-09-12 15:52:03] ../../gcc/gcc/config/alpha/vms.h:148:3: error: macro expands to multiple statements [-Werror=multistatement-macros]
[all 2021-09-12 15:52:03] 148 | (CUM).num_args = 0; \
[all 2021-09-12 15:52:03] | ^
[all 2021-09-12 15:52:03] ../../gcc/gcc/var-tracking.c:6334:17: note: in expansion of macro 'INIT_CUMULATIVE_ARGS'
[all 2021-09-12 15:52:03] 6334 | INIT_CUMULATIVE_ARGS (args_so_far_v, type, NULL_RTX, fndecl,
[all 2021-09-12 15:52:03] | ^~~~~~~~~~~~~~~~~~~~
[all 2021-09-12 15:52:03] ../../gcc/gcc/var-tracking.c:6332:15: note: some parts of macro expansion are not guarded by this 'else' clause
[all 2021-09-12 15:52:03] 6332 | else
[all 2021-09-12 15:52:03] | ^~~~
[all 2021-09-12 15:52:20] cc1plus: all warnings being treated as errors
[all 2021-09-12 15:52:20] make[1]: *** [Makefile:1143: var-tracking.o] Error 1
[all 2021-09-12 15:52:20] make[1]: Leaving directory '/var/lib/laminar/run/gcc-alpha64-dec-vms/8/toolchain-build/gcc'
[all 2021-09-12 15:52:20] make: *** [Makefile:4425: all-gcc] Error 2
gcc/ChangeLog:
* config/alpha/vms.h (INIT_CUMULATIVE_ARGS): Wrap multi-statment
define into a block.
diff --git a/gcc/config/alpha/vms.h b/gcc/config/alpha/vms.h
index b8673b6b6fb..e979aef10c7 100644
--- a/gcc/config/alpha/vms.h
+++ b/gcc/config/alpha/vms.h
@@ -145,9 +145,13 @@ typedef struct {int num_args; enum avms_arg_type atypes[6];} avms_arg_info;
#undef INIT_CUMULATIVE_ARGS
#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
- (CUM).num_args = 0; \
- (CUM).atypes[0] = (CUM).atypes[1] = (CUM).atypes[2] = I64; \
- (CUM).atypes[3] = (CUM).atypes[4] = (CUM).atypes[5] = I64;
+ do \
+ { \
+ (CUM).num_args = 0; \
+ (CUM).atypes[0] = (CUM).atypes[1] = (CUM).atypes[2] = I64; \
+ (CUM).atypes[3] = (CUM).atypes[4] = (CUM).atypes[5] = I64; \
+ } \
+ while (0)
#define DEFAULT_PCC_STRUCT_RETURN 0
Okay for trunk?
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] Fix multi-statement define for alpha-dec-vms
2021-09-12 18:12 [PATCH] Fix multi-statement define for alpha-dec-vms Jan-Benedict Glaw
@ 2021-09-13 9:11 ` Richard Biener
2021-09-13 10:19 ` Jan-Benedict Glaw
0 siblings, 1 reply; 3+ messages in thread
From: Richard Biener @ 2021-09-13 9:11 UTC (permalink / raw)
To: Jan-Benedict Glaw; +Cc: Douglas Rupp, Tristan Gingold, GCC Patches
On Sun, Sep 12, 2021 at 8:12 PM Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:
>
> Hi!
>
> While mass-building a cross-gcc, I noticed that for
> alpha-dec-vms/alpha64-dec-vms, recent GCC versions correctly throw a warning
> due to a multi-statement define that gets rippen in an if/else case:
>
> [all 2021-09-12 15:51:55] /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 -Wno-error=format-diag -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 value-prof.o -MT value-prof.o -MMD -MP -MF ./.deps/value-prof.TPo ../../gcc/gcc/value-prof.c
> [all 2021-09-12 15:52:01] /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 -Wno-error=format-diag -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 var-tracking.o -MT var-tracking.o -MMD -MP -MF ./.deps/var-tracking.TPo ../../gcc/gcc/var-tracking.c
> [all 2021-09-12 15:52:03] In file included from ./tm.h:21,
> [all 2021-09-12 15:52:03] from ../../gcc/gcc/backend.h:28,
> [all 2021-09-12 15:52:03] from ../../gcc/gcc/var-tracking.c:91:
> [all 2021-09-12 15:52:03] ../../gcc/gcc/var-tracking.c: In function 'void prepare_call_arguments(basic_block, rtx_insn*)':
> [all 2021-09-12 15:52:03] ../../gcc/gcc/config/alpha/vms.h:148:3: error: macro expands to multiple statements [-Werror=multistatement-macros]
> [all 2021-09-12 15:52:03] 148 | (CUM).num_args = 0; \
> [all 2021-09-12 15:52:03] | ^
> [all 2021-09-12 15:52:03] ../../gcc/gcc/var-tracking.c:6334:17: note: in expansion of macro 'INIT_CUMULATIVE_ARGS'
> [all 2021-09-12 15:52:03] 6334 | INIT_CUMULATIVE_ARGS (args_so_far_v, type, NULL_RTX, fndecl,
> [all 2021-09-12 15:52:03] | ^~~~~~~~~~~~~~~~~~~~
> [all 2021-09-12 15:52:03] ../../gcc/gcc/var-tracking.c:6332:15: note: some parts of macro expansion are not guarded by this 'else' clause
> [all 2021-09-12 15:52:03] 6332 | else
> [all 2021-09-12 15:52:03] | ^~~~
> [all 2021-09-12 15:52:20] cc1plus: all warnings being treated as errors
> [all 2021-09-12 15:52:20] make[1]: *** [Makefile:1143: var-tracking.o] Error 1
> [all 2021-09-12 15:52:20] make[1]: Leaving directory '/var/lib/laminar/run/gcc-alpha64-dec-vms/8/toolchain-build/gcc'
> [all 2021-09-12 15:52:20] make: *** [Makefile:4425: all-gcc] Error 2
>
>
>
>
> gcc/ChangeLog:
>
> * config/alpha/vms.h (INIT_CUMULATIVE_ARGS): Wrap multi-statment
> define into a block.
>
>
> diff --git a/gcc/config/alpha/vms.h b/gcc/config/alpha/vms.h
> index b8673b6b6fb..e979aef10c7 100644
> --- a/gcc/config/alpha/vms.h
> +++ b/gcc/config/alpha/vms.h
> @@ -145,9 +145,13 @@ typedef struct {int num_args; enum avms_arg_type atypes[6];} avms_arg_info;
>
> #undef INIT_CUMULATIVE_ARGS
> #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
> - (CUM).num_args = 0; \
> - (CUM).atypes[0] = (CUM).atypes[1] = (CUM).atypes[2] = I64; \
> - (CUM).atypes[3] = (CUM).atypes[4] = (CUM).atypes[5] = I64;
> + do \
> + { \
> + (CUM).num_args = 0; \
> + (CUM).atypes[0] = (CUM).atypes[1] = (CUM).atypes[2] = I64; \
> + (CUM).atypes[3] = (CUM).atypes[4] = (CUM).atypes[5] = I64; \
> + } \
> + while (0)
>
> #define DEFAULT_PCC_STRUCT_RETURN 0
>
>
>
>
> Okay for trunk?
OK.
Thanks,
Richard.
> Thanks,
> Jan-Benedict
>
> --
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix multi-statement define for alpha-dec-vms
2021-09-13 9:11 ` Richard Biener
@ 2021-09-13 10:19 ` Jan-Benedict Glaw
0 siblings, 0 replies; 3+ messages in thread
From: Jan-Benedict Glaw @ 2021-09-13 10:19 UTC (permalink / raw)
To: Richard Biener; +Cc: Douglas Rupp, Tristan Gingold, GCC Patches
[-- Attachment #1: Type: text/plain, Size: 359 bytes --]
Hi!
On Mon, 2021-09-13 11:11:30 +0200, Richard Biener <richard.guenther@gmail.com> wrote:
> On Sun, Sep 12, 2021 at 8:12 PM Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:
> > gcc/ChangeLog:
> >
> > * config/alpha/vms.h (INIT_CUMULATIVE_ARGS): Wrap multi-statment
> > define into a block.
> OK.
Committed, thanks!
MfG, JBG
--
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-09-13 10:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-12 18:12 [PATCH] Fix multi-statement define for alpha-dec-vms Jan-Benedict Glaw
2021-09-13 9:11 ` Richard Biener
2021-09-13 10:19 ` Jan-Benedict Glaw
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).