Patchwork RFA (build): enum conversion fix for genopinit FIXUNS_TRUNC_LIKE_FIX_TRUNC code

login
register
mail settings
Submitter Joern Rennecke
Date Nov. 4, 2010, 7:56 p.m.
Message ID <20101104155615.fx1uhgwa8s0k4soo-nzlynne@webmail.spamcop.net>
Download mbox | patch
Permalink /patch/70161/
State New
Headers show

Comments

Joern Rennecke - Nov. 4, 2010, 7:56 p.m.
The h8300-elf --enable-werror-all build has found some generated code
in insn-optint.c that passes integers to functions that expect
enum machine_mode arguments.

Fixed with the genopinit.c patch below.

bootstrapped on i686-pc-linux-gnu.

An alternative approach would have been to declare the iteration variables
as enum machine_mode, but then a cast would have been requierd for each
iteration variable increment.

2010-11-04  Joern Rennecke  <amylaar@spamcop.net>

	PR bootstrap/44756
	* genopinit.c (main) [FIXUNS_TRUNC_LIKE_FIX_TRUNC]: Cast
	iteration variables to enum machine_mode.
Richard Henderson - Nov. 4, 2010, 8:28 p.m.
On 11/04/2010 12:56 PM, Joern Rennecke wrote:
> 	PR bootstrap/44756
> 	* genopinit.c (main) [FIXUNS_TRUNC_LIKE_FIX_TRUNC]: Cast
> 	iteration variables to enum machine_mode.

Ok.


r~

Patch

Index: genopinit.c
===================================================================
--- genopinit.c	(revision 166313)
+++ genopinit.c	(working copy)
@@ -524,8 +524,9 @@  from the machine description file `md'. 
   for (i = 0; i < NUM_MACHINE_MODES; i++)\n\
     for (j = 0; j < NUM_MACHINE_MODES; j++)\n\
       set_convert_optab_handler\n\
- 	(ufixtrunc_optab, i, j,\n\
-	 convert_optab_handler (sfixtrunc_optab, i, j));\n\
+ 	(ufixtrunc_optab, (enum machine_mode) i, (enum machine_mode) j,\n\
+	 convert_optab_handler (sfixtrunc_optab, (enum machine_mode) i,\n\
+						 (enum machine_mode) j));\n\
 #endif\n\
 }");