On Mon, Apr 21, 2014 at 10:15:19AM -0700, Richard Henderson wrote:
> On 04/21/2014 09:53 AM, Jan-Benedict Glaw wrote:
> > /home/jbglaw/repos/gcc/gcc/config/sparc/sparc.c:4858: error: invalid
> > conversion from ‘int’ to ‘machine_mode’
>
>
> Yes, something has changed recently in the build flags to (I believe) remove
> -fpermissive. Quite a few backends are affected by this change.
>
> I've already fixed a similar error in the aarch64 backend. I've got a patch
> fixing sparc, but havn't committed or posted it yet.
Actually, the change was in the GET_MODE_SIZE (and a few others macros),
previously they would happily accept int argument, now they (in C++) require
enum machine_mode.
Previously it was:
#define GET_MODE_SIZE(MODE) ((unsigned short) mode_size[MODE])
and now for recent GCC it is:
#define GET_MODE_SIZE(MODE) \
((unsigned short) (__builtin_constant_p (MODE) \
? mode_size_inline (MODE) : mode_size[MODE]))
Sure, we could change this to use mode_size_inline ((enum machine_mode) (MODE))
in the macro instead, but I'd say for GCC codebase it is better if we fix
the few users of these macros that pass an int rather than enum machine_mode
to these macros.
Jakub