re PR target/60910 (sparc-linux bootstrap failure due to many "invalid conversion from 'int' to 'machine_mode'" errors)

PR target/60910
	* config/sparc/sparc.c (sparc_init_modes): Pass enum machine_mode
	value instead of int to GET_MODE_CLASS and GET_MODE_SIZE macros.

From-SVN: r209555
This commit is contained in:
Jakub Jelinek 2014-04-22 09:25:12 +02:00 committed by Jakub Jelinek
parent e5dcd6954a
commit 4552e70cf7
2 changed files with 20 additions and 13 deletions

View file

@ -1,3 +1,9 @@
2014-04-22 Jakub Jelinek <jakub@redhat.com>
PR target/60910
* config/sparc/sparc.c (sparc_init_modes): Pass enum machine_mode
value instead of int to GET_MODE_CLASS and GET_MODE_SIZE macros.
2014-04-22 Lin Zuojian <manjian2006@gmail.com>
PR middle-end/60281

View file

@ -4821,47 +4821,48 @@ sparc_init_modes (void)
for (i = 0; i < NUM_MACHINE_MODES; i++)
{
switch (GET_MODE_CLASS (i))
enum machine_mode m = (enum machine_mode) i;
switch (GET_MODE_CLASS (m))
{
case MODE_INT:
case MODE_PARTIAL_INT:
case MODE_COMPLEX_INT:
if (GET_MODE_SIZE (i) < 4)
if (GET_MODE_SIZE (m) < 4)
sparc_mode_class[i] = 1 << (int) H_MODE;
else if (GET_MODE_SIZE (i) == 4)
else if (GET_MODE_SIZE (m) == 4)
sparc_mode_class[i] = 1 << (int) S_MODE;
else if (GET_MODE_SIZE (i) == 8)
else if (GET_MODE_SIZE (m) == 8)
sparc_mode_class[i] = 1 << (int) D_MODE;
else if (GET_MODE_SIZE (i) == 16)
else if (GET_MODE_SIZE (m) == 16)
sparc_mode_class[i] = 1 << (int) T_MODE;
else if (GET_MODE_SIZE (i) == 32)
else if (GET_MODE_SIZE (m) == 32)
sparc_mode_class[i] = 1 << (int) O_MODE;
else
sparc_mode_class[i] = 0;
break;
case MODE_VECTOR_INT:
if (GET_MODE_SIZE (i) == 4)
if (GET_MODE_SIZE (m) == 4)
sparc_mode_class[i] = 1 << (int) SF_MODE;
else if (GET_MODE_SIZE (i) == 8)
else if (GET_MODE_SIZE (m) == 8)
sparc_mode_class[i] = 1 << (int) DF_MODE;
else
sparc_mode_class[i] = 0;
break;
case MODE_FLOAT:
case MODE_COMPLEX_FLOAT:
if (GET_MODE_SIZE (i) == 4)
if (GET_MODE_SIZE (m) == 4)
sparc_mode_class[i] = 1 << (int) SF_MODE;
else if (GET_MODE_SIZE (i) == 8)
else if (GET_MODE_SIZE (m) == 8)
sparc_mode_class[i] = 1 << (int) DF_MODE;
else if (GET_MODE_SIZE (i) == 16)
else if (GET_MODE_SIZE (m) == 16)
sparc_mode_class[i] = 1 << (int) TF_MODE;
else if (GET_MODE_SIZE (i) == 32)
else if (GET_MODE_SIZE (m) == 32)
sparc_mode_class[i] = 1 << (int) OF_MODE;
else
sparc_mode_class[i] = 0;
break;
case MODE_CC:
if (i == (int) CCFPmode || i == (int) CCFPEmode)
if (m == CCFPmode || m == CCFPEmode)
sparc_mode_class[i] = 1 << (int) CCFP_MODE;
else
sparc_mode_class[i] = 1 << (int) CC_MODE;