Hans-Peter Nilsson <hans-peter.nils...@axis.com> writes: >> From: Richard Sandiford <richard.sandif...@arm.com> >> Date: Wed, 11 Sep 2019 21:02:26 +0200 > >> This series of patches introduces some classes and helpers for handling >> multiple ABIs in the same translation unit. At the moment "ABI" maans >> specifically the choice of call-clobbered registers > [...] > >> The series also makes -fipa-ra work for partially-clobbered registers too. > [...] > > My autotester for cris-elf complains about a build-breaking > commit in the revision range (working:breaking) 276299:276359 > and a glance at those commits and the error message says the > cause is likely one of your commits. Relevant part of > build-log, hopefully sufficient: > > ----------------------- > 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 -fno-common -DHAVE_CONFIG_H -I. -I. > -I/x/hpautotest-gcc1/gcc/gcc -I/x/hpautotest-gcc1/gcc/gcc/. > -I/x/hpautotest-gcc1/gcc/gcc/../include > -I/x/hpautotest-gcc1/gcc/gcc/../libcpp/include > -I/x/hpautotest-gcc1/cris-elf/gccobj/./gmp -I/x/hpautotest-gcc1/gcc/gmp > -I/x/hpautotest-gcc1/cris-elf/gccobj/./mpfr/src > -I/x/hpautotest-gcc1/gcc/mpfr/src -I/x/hpautotest-gcc1/gcc/mpc/src > -I/x/hpautotest-gcc1/gcc/gcc/../libdecnumber > -I/x/hpautotest-gcc1/gcc/gcc/../libdecnumber/dpd -I../libdecnumber > -I/x/hpautotest-gcc1/gcc/gcc/../libbacktrace -o caller-save.o -MT > caller-save.o -MMD -MP -MF ./.deps/caller-save.TPo > /x/hpautotest-gcc1/gcc/gcc/caller-save.c > In file included from /x/hpautotest-gcc1/gcc/gcc/caller-save.c:31:0: > /x/hpautotest-gcc1/gcc/gcc/caller-save.c: In function 'void > init_caller_save()': > /x/hpautotest-gcc1/gcc/gcc/regs.h:195:44: error: cannot convert 'bool' to > 'const predefined_function_abi*' for argument '3' to 'machine_mode > choose_hard_reg_mode(unsigned int, unsigned int, const > predefined_function_abi*)' > choose_hard_reg_mode (REGNO, NREGS, false) > ^ > /x/hpautotest-gcc1/gcc/gcc/caller-save.c:203:26: note: in expansion of macro > 'HARD_REGNO_CALLER_SAVE_MODE' > regno_save_mode[i][j] = HARD_REGNO_CALLER_SAVE_MODE (i, j, VOIDmode); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~ > /x/hpautotest-gcc1/gcc/gcc/caller-save.c: In function 'void > save_call_clobbered_regs()': > /x/hpautotest-gcc1/gcc/gcc/regs.h:195:44: error: cannot convert 'bool' to > 'const predefined_function_abi*' for argument '3' to 'machine_mode > choose_hard_reg_mode(unsigned int, unsigned int, const > predefined_function_abi*)' > choose_hard_reg_mode (REGNO, NREGS, false) > ^ > /x/hpautotest-gcc1/gcc/gcc/caller-save.c:821:12: note: in expansion of macro > 'HARD_REGNO_CALLER_SAVE_MODE' > mode = HARD_REGNO_CALLER_SAVE_MODE > ^~~~~~~~~~~~~~~~~~~~~~~~~~~ > Makefile:1117: recipe for target 'caller-save.o' failed > ----------------------- > >> Also tested by compiling at least one target per CPU directory and >> checking for no new warnings. > > (Hmm... So maybe a host gcc issue?)
Bah, yeah, seems so. > My host is x86-64 Debian 9, i.e. gcc-6.3.0. Mine was 5.4.0, which only treats this as a warning. Normally I check for extra warnings too, but mustn't have done this time, sorry. Fixed as below. I also belatedly see a new definition of HARD_REGNO_CALLER_SAVE_MODE was added since I posted the patches, so the patch fixes that too. Tested by cross-building cris-elf and sparc-linux-gnu, applied as obvious. Richard 2019-10-01 Richard Sandiford <richard.sandif...@arm.com> gcc/ * regs.h (HARD_REGNO_CALLER_SAVE_MODE): Update call to choose_hard_reg_mode. * config/sparc/sparc.h (HARD_REGNO_CALLER_SAVE_MODE): Likewise. Index: gcc/regs.h =================================================================== --- gcc/regs.h 2019-09-30 17:19:45.047128655 +0100 +++ gcc/regs.h 2019-10-01 08:46:22.368168133 +0100 @@ -192,7 +192,7 @@ #define REG_BASIC_BLOCK(N) (reg_info_p[N /* Select a register mode required for caller save of hard regno REGNO. */ #ifndef HARD_REGNO_CALLER_SAVE_MODE #define HARD_REGNO_CALLER_SAVE_MODE(REGNO, NREGS, MODE) \ - choose_hard_reg_mode (REGNO, NREGS, false) + choose_hard_reg_mode (REGNO, NREGS, NULL) #endif /* Target-dependent globals. */ Index: gcc/config/sparc/sparc.h =================================================================== --- gcc/config/sparc/sparc.h 2019-09-21 13:56:08.855935013 +0100 +++ gcc/config/sparc/sparc.h 2019-10-01 08:46:22.368168133 +0100 @@ -716,7 +716,7 @@ #define HARD_REGNO_RENAME_OK(FROM, TO) ( mode but the largest suitable mode for the given (REGNO, NREGS) pair and it quickly creates paradoxical subregs that can be problematic. */ #define HARD_REGNO_CALLER_SAVE_MODE(REGNO, NREGS, MODE) \ - ((MODE) == VOIDmode ? choose_hard_reg_mode (REGNO, NREGS, false) : (MODE)) + ((MODE) == VOIDmode ? choose_hard_reg_mode (REGNO, NREGS, NULL) : (MODE)) /* Specify the registers used for certain standard purposes. The values of these macros are register numbers. */