http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44749

--- Comment #4 from Jorn Wolfgang Rennecke <amylaar at gcc dot gnu.org> 
2010-11-03 12:15:16 UTC ---
mep-elf still doesn't build when configured with --enable-werror-always.

gcc -c   -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wwrite-strings
-Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute
-pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror
-Wold-style-definition -Wc++-compat -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/../libdecnumber
-I../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber  -DCLOOG_PPL_BACKEND  
../../gcc/gcc/combine.c -o combine.o
../../gcc/gcc/combine.c: In function ‘subst’:
../../gcc/gcc/combine.c:5056:12: error: enum conversion when passing argument 3
of ‘mep_cannot_change_mode_class’ is invalid in C++ [-Werror=c++-compat]
../../gcc/gcc/config/mep/mep-protos.h:104:13: note: expected ‘enum reg_class’
but argument is of type ‘int’
../../gcc/gcc/combine.c: In function ‘simplify_set’:
../../gcc/gcc/combine.c:6372:9: error: enum conversion when passing argument 3
of ‘mep_cannot_change_mode_class’ is invalid in C++ [-Werror=c++-compat]
../../gcc/gcc/config/mep/mep-protos.h:104:13: note: expected ‘enum reg_class’
but argument is of type ‘int’

combine uses REG_CANNOT_CHANGE_MODE_P, which is defined in hard-reg-set.h:

#define REG_CANNOT_CHANGE_MODE_P(REGN, FROM, TO)                          \
         CANNOT_CHANGE_MODE_CLASS (FROM, TO, REGNO_REG_CLASS (REGN))

these macros are defined in mep.h like this:
#define REGNO_REG_CLASS(REGNO) mep_regno_reg_class (REGNO)

#define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \
  mep_cannot_change_mode_class (FROM, TO, CLASS)

Unfortunately, argument three of mep_cannot_change_mode_class doesn't
accept (in C++) the result of mep_regno_reg_class:

extern bool mep_cannot_change_mode_class (enum machine_mode, enum machine_mode,
                                          enum reg_class);

extern int mep_regno_reg_class (int);

it would be better if the two functions could agree on using reg_class_t .

Of course, when fixing this, we later run into PR44765.

Reply via email to