[proposed patch for PR target/12081, from http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12081#c19.
 backported to 4.7.3 <mikpe@it.uu.se>]

--- gcc-4.7.3/gcc/config/alpha/alpha.c.~1~	2012-08-09 20:44:40.000000000 +0200
+++ gcc-4.7.3/gcc/config/alpha/alpha.c	2013-05-25 10:45:12.413139309 +0200
@@ -6611,16 +6611,16 @@ alpha_expand_builtin (tree exp, rtx targ
   switch (arity)
     {
     case 0:
-      pat = GEN_FCN (icode) (target);
+      pat = GEN_FCN1 (icode) (target);
       break;
     case 1:
       if (nonvoid)
-        pat = GEN_FCN (icode) (target, op[0]);
+        pat = GEN_FCN2 (icode) (target, op[0]);
       else
-	pat = GEN_FCN (icode) (op[0]);
+	pat = GEN_FCN1 (icode) (op[0]);
       break;
     case 2:
-      pat = GEN_FCN (icode) (target, op[0], op[1]);
+      pat = GEN_FCN3 (icode) (target, op[0], op[1]);
       break;
     default:
       gcc_unreachable ();
--- gcc-4.7.3/gcc/config/arm/arm.c.~1~	2013-03-18 12:52:08.000000000 +0100
+++ gcc-4.7.3/gcc/config/arm/arm.c	2013-05-25 10:47:13.723032073 +0200
@@ -20562,7 +20562,7 @@ arm_expand_binop_builtin (enum insn_code
   if (! (*insn_data[icode].operand[2].predicate) (op1, mode1))
     op1 = copy_to_mode_reg (mode1, op1);
 
-  pat = GEN_FCN (icode) (target, op0, op1);
+  pat = GEN_FCN3 (icode) (target, op0, op1);
   if (! pat)
     return 0;
   emit_insn (pat);
@@ -20596,7 +20596,7 @@ arm_expand_unop_builtin (enum insn_code
 	op0 = copy_to_mode_reg (mode0, op0);
     }
 
-  pat = GEN_FCN (icode) (target, op0);
+  pat = GEN_FCN2 (icode) (target, op0);
   if (! pat)
     return 0;
   emit_insn (pat);
@@ -20755,23 +20755,23 @@ arm_expand_neon_args (rtx target, int ic
     switch (argc)
       {
       case 1:
-	pat = GEN_FCN (icode) (target, op[0]);
+	pat = GEN_FCN2 (icode) (target, op[0]);
 	break;
 
       case 2:
-	pat = GEN_FCN (icode) (target, op[0], op[1]);
+	pat = GEN_FCN3 (icode) (target, op[0], op[1]);
 	break;
 
       case 3:
-	pat = GEN_FCN (icode) (target, op[0], op[1], op[2]);
+	pat = GEN_FCN4 (icode) (target, op[0], op[1], op[2]);
 	break;
 
       case 4:
-	pat = GEN_FCN (icode) (target, op[0], op[1], op[2], op[3]);
+	pat = GEN_FCN5 (icode) (target, op[0], op[1], op[2], op[3]);
 	break;
 
       case 5:
-	pat = GEN_FCN (icode) (target, op[0], op[1], op[2], op[3], op[4]);
+	pat = GEN_FCN6 (icode) (target, op[0], op[1], op[2], op[3], op[4]);
 	break;
 
       default:
@@ -20781,23 +20781,23 @@ arm_expand_neon_args (rtx target, int ic
     switch (argc)
       {
       case 1:
-	pat = GEN_FCN (icode) (op[0]);
+	pat = GEN_FCN1 (icode) (op[0]);
 	break;
 
       case 2:
-	pat = GEN_FCN (icode) (op[0], op[1]);
+	pat = GEN_FCN2 (icode) (op[0], op[1]);
 	break;
 
       case 3:
-	pat = GEN_FCN (icode) (op[0], op[1], op[2]);
+	pat = GEN_FCN3 (icode) (op[0], op[1], op[2]);
 	break;
 
       case 4:
-	pat = GEN_FCN (icode) (op[0], op[1], op[2], op[3]);
+	pat = GEN_FCN4 (icode) (op[0], op[1], op[2], op[3]);
 	break;
 
       case 5:
-	pat = GEN_FCN (icode) (op[0], op[1], op[2], op[3], op[4]);
+	pat = GEN_FCN5 (icode) (op[0], op[1], op[2], op[3], op[4]);
         break;
 
       default:
@@ -21101,7 +21101,7 @@ arm_expand_builtin (tree exp,
 	  || GET_MODE (target) != tmode
 	  || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
 	target = gen_reg_rtx (tmode);
-      pat = GEN_FCN (icode) (target, op0, op1);
+      pat = GEN_FCN3 (icode) (target, op0, op1);
       if (! pat)
 	return 0;
       emit_insn (pat);
@@ -21138,7 +21138,7 @@ arm_expand_builtin (tree exp,
 	  || GET_MODE (target) != tmode
 	  || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
 	target = gen_reg_rtx (tmode);
-      pat = GEN_FCN (icode) (target, op0, op1, op2);
+      pat = GEN_FCN4 (icode) (target, op0, op1, op2);
       if (! pat)
 	return 0;
       emit_insn (pat);
@@ -21181,7 +21181,7 @@ arm_expand_builtin (tree exp,
 	  || GET_MODE (target) != tmode
 	  || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
 	target = gen_reg_rtx (tmode);
-      pat = GEN_FCN (icode) (target, op0, op1);
+      pat = GEN_FCN3 (icode) (target, op0, op1);
       if (! pat)
 	return 0;
       emit_insn (pat);
@@ -21236,7 +21236,7 @@ arm_expand_builtin (tree exp,
 	  || GET_MODE (target) != tmode
 	  || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
 	target = gen_reg_rtx (tmode);
-      pat = GEN_FCN (icode) (target, op0, op1, op2);
+      pat = GEN_FCN4 (icode) (target, op0, op1, op2);
       if (! pat)
 	return 0;
       emit_insn (pat);
--- gcc-4.7.3/gcc/config/arm/arm.md.~1~	2013-02-01 15:14:11.000000000 +0100
+++ gcc-4.7.3/gcc/config/arm/arm.md	2013-05-25 10:45:12.423139296 +0200
@@ -8773,8 +8773,8 @@ (define_expand "casesi"
     if (!insn_data[(int) code].operand[1].predicate(operands[2], SImode))
       operands[2] = force_reg (SImode, operands[2]);
 
-    emit_jump_insn (GEN_FCN ((int) code) (operands[0], operands[2],
-					  operands[3], operands[4]));
+    emit_jump_insn (GEN_FCN4 ((int) code) (operands[0], operands[2],
+					   operands[3], operands[4]));
     DONE;
   }"
 )
--- gcc-4.7.3/gcc/config/avr/avr.c.~1~	2013-01-07 19:51:33.000000000 +0100
+++ gcc-4.7.3/gcc/config/avr/avr.c	2013-05-25 10:48:59.822994088 +0200
@@ -10475,7 +10475,7 @@ avr_expand_unop_builtin (enum insn_code
   if (! (*insn_data[icode].operand[1].predicate) (op0, mode0))
     op0 = copy_to_mode_reg (mode0, op0);
 
-  pat = GEN_FCN (icode) (target, op0);
+  pat = GEN_FCN2 (icode) (target, op0);
   if (! pat)
     return 0;
   
@@ -10532,7 +10532,7 @@ avr_expand_binop_builtin (enum insn_code
   if (! (*insn_data[icode].operand[2].predicate) (op1, mode1))
     op1 = copy_to_mode_reg (mode1, op1);
 
-  pat = GEN_FCN (icode) (target, op0, op1);
+  pat = GEN_FCN3 (icode) (target, op0, op1);
   
   if (! pat)
     return 0;
@@ -10602,7 +10602,7 @@ avr_expand_triop_builtin (enum insn_code
   if (! (*insn_data[icode].operand[3].predicate) (op2, mode2))
     op2 = copy_to_mode_reg (mode2, op2);
 
-  pat = GEN_FCN (icode) (target, op0, op1, op2);
+  pat = GEN_FCN4 (icode) (target, op0, op1, op2);
   
   if (! pat)
     return 0;
@@ -10672,7 +10672,7 @@ avr_expand_builtin (tree exp, rtx target
   switch (d->n_args)
     {
     case 0:
-      emit_insn ((GEN_FCN (d->icode)) (target));
+      emit_insn ((GEN_FCN1 (d->icode)) (target));
       return 0;
       
     case 1:
--- gcc-4.7.3/gcc/config/bfin/bfin.c.~1~	2011-12-30 19:56:49.000000000 +0100
+++ gcc-4.7.3/gcc/config/bfin/bfin.c	2013-05-25 10:45:12.433139286 +0200
@@ -5358,9 +5358,9 @@ bfin_expand_binop_builtin (enum insn_cod
     op1 = copy_to_mode_reg (mode1, op1);
 
   if (macflag == -1)
-    pat = GEN_FCN (icode) (target, op0, op1);
+    pat = GEN_FCN3 (icode) (target, op0, op1);
   else
-    pat = GEN_FCN (icode) (target, op0, op1, GEN_INT (macflag));
+    pat = GEN_FCN4 (icode) (target, op0, op1, GEN_INT (macflag));
   if (! pat)
     return 0;
 
@@ -5399,7 +5399,7 @@ bfin_expand_unop_builtin (enum insn_code
   if (! (*insn_data[icode].operand[1].predicate) (op0, mode0))
     op0 = copy_to_mode_reg (mode0, op0);
 
-  pat = GEN_FCN (icode) (target, op0);
+  pat = GEN_FCN2 (icode) (target, op0);
   if (! pat)
     return 0;
   emit_insn (pat);
@@ -5458,7 +5458,7 @@ bfin_expand_builtin (tree exp, rtx targe
       if (! (*insn_data[icode].operand[1].predicate) (op0, mode0))
 	op0 = copy_to_mode_reg (mode0, op0);
 
-      pat = GEN_FCN (icode) (target, op0, op0);
+      pat = GEN_FCN3 (icode) (target, op0, op0);
       if (! pat)
 	return 0;
       emit_insn (pat);
--- gcc-4.7.3/gcc/config/bfin/bfin.md.~1~	2011-09-14 23:15:09.000000000 +0200
+++ gcc-4.7.3/gcc/config/bfin/bfin.md	2013-05-25 10:45:12.433139286 +0200
@@ -984,10 +984,10 @@ (define_expand "<optab>di3"
   split_di (operands, 3, lo_half, hi_half);
   if (!(*insn_data[icode].operand[2].predicate) (lo_half[2], SImode))
     lo_half[2] = force_reg (SImode, lo_half[2]);
-  emit_insn (GEN_FCN (icode) (lo_half[0], lo_half[1], lo_half[2]));
+  emit_insn (GEN_FCN3 (icode) (lo_half[0], lo_half[1], lo_half[2]));
   if (!(*insn_data[icode].operand[2].predicate) (hi_half[2], SImode))
     hi_half[2] = force_reg (SImode, hi_half[2]);
-  emit_insn (GEN_FCN (icode) (hi_half[0], hi_half[1], hi_half[2]));
+  emit_insn (GEN_FCN3 (icode) (hi_half[0], hi_half[1], hi_half[2]));
   DONE;
 })
 
--- gcc-4.7.3/gcc/config/c6x/c6x.c.~1~	2012-02-15 01:38:04.000000000 +0100
+++ gcc-4.7.3/gcc/config/c6x/c6x.c	2013-05-25 10:45:12.433139286 +0200
@@ -1770,7 +1770,7 @@ c6x_expand_movmem (rtx dst, rtx src, rtx
 	{
 	  enum insn_code icode = (srcmode == SImode ? CODE_FOR_movmisalignsi
 				  : CODE_FOR_movmisaligndi);
-	  emit_insn (GEN_FCN (icode) (reg_lowpart, srcmem));
+	  emit_insn (GEN_FCN2 (icode) (reg_lowpart, srcmem));
 	}
       else
 	emit_move_insn (reg_lowpart, srcmem);
@@ -1804,7 +1804,7 @@ c6x_expand_movmem (rtx dst, rtx src, rtx
 	    {
 	      enum insn_code icode = (dstmode == SImode ? CODE_FOR_movmisalignsi
 				      : CODE_FOR_movmisaligndi);
-	      emit_insn (GEN_FCN (icode) (dstmem, dstreg));
+	      emit_insn (GEN_FCN2 (icode) (dstmem, dstreg));
 	    }
 	  else
 	    emit_move_insn (dstmem, dstreg);
@@ -6577,9 +6577,9 @@ c6x_expand_binop_builtin (enum insn_code
     op1 = copy_to_mode_reg (mode1, op1);
 
   if (match_op)
-    pat = GEN_FCN (icode) (target, target, op0, op1);
+    pat = GEN_FCN4 (icode) (target, target, op0, op1);
   else
-    pat = GEN_FCN (icode) (target, op0, op1);
+    pat = GEN_FCN3 (icode) (target, op0, op1);
 
   if (! pat)
     return 0;
@@ -6620,7 +6620,7 @@ c6x_expand_unop_builtin (enum insn_code
   if (! (*insn_data[icode].operand[1].predicate) (op0, mode0))
     op0 = copy_to_mode_reg (mode0, op0);
 
-  pat = GEN_FCN (icode) (target, op0);
+  pat = GEN_FCN2 (icode) (target, op0);
   if (! pat)
     return 0;
   emit_insn (pat);
--- gcc-4.7.3/gcc/config/frv/frv.c.~1~	2012-08-06 16:34:27.000000000 +0200
+++ gcc-4.7.3/gcc/config/frv/frv.c	2013-05-25 10:45:12.433139286 +0200
@@ -8862,7 +8862,7 @@ frv_expand_set_builtin (enum insn_code i
     return NULL_RTX;
 
   target = frv_legitimize_target (icode, target);
-  pat = GEN_FCN (icode) (target, op0);
+  pat = GEN_FCN2 (icode) (target, op0);
   if (! pat)
     return NULL_RTX;
 
@@ -8880,7 +8880,7 @@ frv_expand_unop_builtin (enum insn_code
 
   target = frv_legitimize_target (icode, target);
   op0 = frv_legitimize_argument (icode, 1, op0);
-  pat = GEN_FCN (icode) (target, op0);
+  pat = GEN_FCN2 (icode) (target, op0);
   if (! pat)
     return NULL_RTX;
 
@@ -8900,7 +8900,7 @@ frv_expand_binop_builtin (enum insn_code
   target = frv_legitimize_target (icode, target);
   op0 = frv_legitimize_argument (icode, 1, op0);
   op1 = frv_legitimize_argument (icode, 2, op1);
-  pat = GEN_FCN (icode) (target, op0, op1);
+  pat = GEN_FCN3 (icode) (target, op0, op1);
   if (! pat)
     return NULL_RTX;
 
@@ -8933,7 +8933,7 @@ frv_expand_cut_builtin (enum insn_code i
     op1 = frv_legitimize_argument (icode, 2, op1);
 
   op2 = frv_matching_accg_for_acc (op0);
-  pat = GEN_FCN (icode) (target, op0, op1, op2);
+  pat = GEN_FCN4 (icode) (target, op0, op1, op2);
   if (! pat)
     return NULL_RTX;
 
@@ -8955,7 +8955,7 @@ frv_expand_binopimm_builtin (enum insn_c
 
   target = frv_legitimize_target (icode, target);
   op0 = frv_legitimize_argument (icode, 1, op0);
-  pat = GEN_FCN (icode) (target, op0, op1);
+  pat = GEN_FCN3 (icode) (target, op0, op1);
   if (! pat)
     return NULL_RTX;
 
@@ -8994,7 +8994,7 @@ frv_expand_voidbinop_builtin (enum insn_
 
   op0 = change_address (op0, V4SImode, addr);
   op1 = frv_legitimize_argument (icode, 1, op1);
-  pat = GEN_FCN (icode) (op0, op1);
+  pat = GEN_FCN2 (icode) (op0, op1);
   if (! pat)
     return 0;
 
@@ -9013,7 +9013,7 @@ frv_expand_int_void2arg (enum insn_code
 
   op0 = frv_legitimize_argument (icode, 1, op0);
   op1 = frv_legitimize_argument (icode, 1, op1);
-  pat = GEN_FCN (icode) (op0, op1);
+  pat = GEN_FCN2 (icode) (op0, op1);
   if (! pat)
     return NULL_RTX;
 
@@ -9029,7 +9029,7 @@ frv_expand_prefetches (enum insn_code ic
   rtx pat;
   rtx op0 = frv_read_argument (call, 0);
 
-  pat = GEN_FCN (icode) (force_reg (Pmode, op0));
+  pat = GEN_FCN1 (icode) (force_reg (Pmode, op0));
   if (! pat)
     return 0;
 
@@ -9058,7 +9058,7 @@ frv_expand_voidtriop_builtin (enum insn_
   op1 = frv_legitimize_argument (icode, 1, op1);
   op2 = frv_legitimize_argument (icode, 2, op2);
   op3 = frv_matching_accg_for_acc (op0);
-  pat = GEN_FCN (icode) (op0, op1, op2, op3);
+  pat = GEN_FCN4 (icode) (op0, op1, op2, op3);
   if (! pat)
     return NULL_RTX;
 
@@ -9089,7 +9089,7 @@ frv_expand_voidaccop_builtin (enum insn_
 
   op2 = frv_matching_accg_for_acc (op0);
   op3 = frv_matching_accg_for_acc (op1);
-  pat = GEN_FCN (icode) (op0, op1, op2, op3);
+  pat = GEN_FCN4 (icode) (op0, op1, op2, op3);
   if (! pat)
     return NULL_RTX;
 
@@ -9111,7 +9111,7 @@ frv_expand_load_builtin (enum insn_code
     target = gen_reg_rtx (target_mode);
   op0 = frv_volatile_memref (insn_data[icode].operand[0].mode, op0);
   convert_move (target, op0, 1);
-  emit_insn (GEN_FCN (icode) (copy_rtx (op0), cookie, GEN_INT (FRV_IO_READ)));
+  emit_insn (GEN_FCN3 (icode) (copy_rtx (op0), cookie, GEN_INT (FRV_IO_READ)));
   cfun->machine->has_membar_p = 1;
   return target;
 }
@@ -9127,7 +9127,7 @@ frv_expand_store_builtin (enum insn_code
 
   op0 = frv_volatile_memref (insn_data[icode].operand[0].mode, op0);
   convert_move (op0, force_reg (insn_data[icode].operand[0].mode, op1), 1);
-  emit_insn (GEN_FCN (icode) (copy_rtx (op0), cookie, GEN_INT (FRV_IO_WRITE)));
+  emit_insn (GEN_FCN3 (icode) (copy_rtx (op0), cookie, GEN_INT (FRV_IO_WRITE)));
   cfun->machine->has_membar_p = 1;
   return NULL_RTX;
 }
@@ -9162,7 +9162,7 @@ frv_expand_mdpackh_builtin (tree call, r
   emit_move_insn (simplify_gen_subreg (HImode, op1, DImode, 2), arg3);
   emit_move_insn (simplify_gen_subreg (HImode, op1, DImode, 6), arg4);
 
-  pat = GEN_FCN (icode) (target, op0, op1);
+  pat = GEN_FCN3 (icode) (target, op0, op1);
   if (! pat)
     return NULL_RTX;
 
@@ -9184,7 +9184,7 @@ frv_expand_mclracc_builtin (tree call)
   if (! op0)
     return NULL_RTX;
 
-  pat = GEN_FCN (icode) (op0);
+  pat = GEN_FCN1 (icode) (op0);
   if (pat)
     emit_insn (pat);
 
@@ -9196,7 +9196,7 @@ frv_expand_mclracc_builtin (tree call)
 static rtx
 frv_expand_noargs_builtin (enum insn_code icode)
 {
-  rtx pat = GEN_FCN (icode) (const0_rtx);
+  rtx pat = GEN_FCN0 (icode) ();
   if (pat)
     emit_insn (pat);
 
@@ -9217,7 +9217,7 @@ frv_expand_mrdacc_builtin (enum insn_cod
   if (! op0)
     return NULL_RTX;
 
-  pat = GEN_FCN (icode) (target, op0);
+  pat = GEN_FCN2 (icode) (target, op0);
   if (! pat)
     return NULL_RTX;
 
@@ -9241,7 +9241,7 @@ frv_expand_mwtacc_builtin (enum insn_cod
     return NULL_RTX;
 
   op1 = frv_legitimize_argument (icode, 1, op1);
-  pat = GEN_FCN (icode) (op0, op1);
+  pat = GEN_FCN2 (icode) (op0, op1);
   if (pat)
     emit_insn (pat);
 
--- gcc-4.7.3/gcc/config/i386/i386.c.~1~	2013-04-02 18:54:39.000000000 +0200
+++ gcc-4.7.3/gcc/config/i386/i386.c	2013-05-25 10:49:48.532991183 +0200
@@ -27905,7 +27905,7 @@ ix86_expand_binop_builtin (enum insn_cod
   if (!insn_data[icode].operand[2].predicate (op1, mode1))
     op1 = copy_to_mode_reg (mode1, op1);
 
-  pat = GEN_FCN (icode) (target, op0, op1);
+  pat = GEN_FCN3 (icode) (target, op0, op1);
   if (! pat)
     return 0;
 
@@ -28110,31 +28110,31 @@ ix86_expand_multi_arg_builtin (enum insn
   switch (nargs)
     {
     case 1:
-      pat = GEN_FCN (icode) (target, args[0].op);
+      pat = GEN_FCN2 (icode) (target, args[0].op);
       break;
 
     case 2:
       if (tf_p)
-	pat = GEN_FCN (icode) (target, args[0].op, args[1].op,
+	pat = GEN_FCN4 (icode) (target, args[0].op, args[1].op,
 			       GEN_INT ((int)sub_code));
       else if (! comparison_p)
-	pat = GEN_FCN (icode) (target, args[0].op, args[1].op);
+	pat = GEN_FCN3 (icode) (target, args[0].op, args[1].op);
       else
 	{
 	  rtx cmp_op = gen_rtx_fmt_ee (sub_code, GET_MODE (target),
 				       args[0].op,
 				       args[1].op);
 
-	  pat = GEN_FCN (icode) (target, cmp_op, args[0].op, args[1].op);
+	  pat = GEN_FCN4 (icode) (target, cmp_op, args[0].op, args[1].op);
 	}
       break;
 
     case 3:
-      pat = GEN_FCN (icode) (target, args[0].op, args[1].op, args[2].op);
+      pat = GEN_FCN4 (icode) (target, args[0].op, args[1].op, args[2].op);
       break;
 
     case 4:
-      pat = GEN_FCN (icode) (target, args[0].op, args[1].op, args[2].op, args[3].op);
+      pat = GEN_FCN5 (icode) (target, args[0].op, args[1].op, args[2].op, args[3].op);
       break;
 
     default:
@@ -28177,7 +28177,7 @@ ix86_expand_unop_vec_merge_builtin (enum
   if (!insn_data[icode].operand[2].predicate (op1, mode0))
     op1 = copy_to_mode_reg (mode0, op1);
 
-  pat = GEN_FCN (icode) (target, op0, op1);
+  pat = GEN_FCN3 (icode) (target, op0, op1);
   if (! pat)
     return 0;
   emit_insn (pat);
@@ -28229,7 +28229,7 @@ ix86_expand_sse_compare (const struct bu
     op1 = copy_to_mode_reg (mode1, op1);
 
   op2 = gen_rtx_fmt_ee (comparison, mode0, op0, op1);
-  pat = GEN_FCN (d->icode) (target, op0, op1, op2);
+  pat = GEN_FCN4 (d->icode) (target, op0, op1, op2);
   if (! pat)
     return 0;
   emit_insn (pat);
@@ -28276,7 +28276,7 @@ ix86_expand_sse_comi (const struct built
       || !insn_data[d->icode].operand[1].predicate (op1, mode1))
     op1 = copy_to_mode_reg (mode1, op1);
 
-  pat = GEN_FCN (d->icode) (op0, op1);
+  pat = GEN_FCN2 (d->icode) (op0, op1);
   if (! pat)
     return 0;
   emit_insn (pat);
@@ -28315,7 +28315,7 @@ ix86_expand_sse_round (const struct buil
 
   op1 = GEN_INT (d->comparison);
 
-  pat = GEN_FCN (d->icode) (target, op0, op1);
+  pat = GEN_FCN3 (d->icode) (target, op0, op1);
   if (! pat)
     return 0;
   emit_insn (pat);
@@ -28353,7 +28353,7 @@ ix86_expand_sse_round_vec_pack_sfix (con
 
   op2 = GEN_INT (d->comparison);
 
-  pat = GEN_FCN (d->icode) (target, op0, op1, op2);
+  pat = GEN_FCN4 (d->icode) (target, op0, op1, op2);
   if (! pat)
     return 0;
   emit_insn (pat);
@@ -28391,7 +28391,7 @@ ix86_expand_sse_ptest (const struct buil
       || !insn_data[d->icode].operand[1].predicate (op1, mode1))
     op1 = copy_to_mode_reg (mode1, op1);
 
-  pat = GEN_FCN (d->icode) (op0, op1);
+  pat = GEN_FCN2 (d->icode) (op0, op1);
   if (! pat)
     return 0;
   emit_insn (pat);
@@ -28462,7 +28462,7 @@ ix86_expand_sse_pcmpestr (const struct b
 
       scratch1 = gen_reg_rtx (tmode1);
 
-      pat = GEN_FCN (d->icode) (target, scratch1, op0, op1, op2, op3, op4);
+      pat = GEN_FCN7 (d->icode) (target, scratch1, op0, op1, op2, op3, op4);
     }
   else if (d->code == IX86_BUILTIN_PCMPESTRM128)
     {
@@ -28473,7 +28473,7 @@ ix86_expand_sse_pcmpestr (const struct b
 
       scratch0 = gen_reg_rtx (tmode0);
 
-      pat = GEN_FCN (d->icode) (scratch0, target, op0, op1, op2, op3, op4);
+      pat = GEN_FCN7 (d->icode) (scratch0, target, op0, op1, op2, op3, op4);
     }
   else
     {
@@ -28482,7 +28482,7 @@ ix86_expand_sse_pcmpestr (const struct b
       scratch0 = gen_reg_rtx (tmode0);
       scratch1 = gen_reg_rtx (tmode1);
 
-      pat = GEN_FCN (d->icode) (scratch0, scratch1, op0, op1, op2, op3, op4);
+      pat = GEN_FCN7 (d->icode) (scratch0, scratch1, op0, op1, op2, op3, op4);
     }
 
   if (! pat)
@@ -28557,7 +28557,7 @@ ix86_expand_sse_pcmpistr (const struct b
 
       scratch1 = gen_reg_rtx (tmode1);
 
-      pat = GEN_FCN (d->icode) (target, scratch1, op0, op1, op2);
+      pat = GEN_FCN5 (d->icode) (target, scratch1, op0, op1, op2);
     }
   else if (d->code == IX86_BUILTIN_PCMPISTRM128)
     {
@@ -28568,7 +28568,7 @@ ix86_expand_sse_pcmpistr (const struct b
 
       scratch0 = gen_reg_rtx (tmode0);
 
-      pat = GEN_FCN (d->icode) (scratch0, target, op0, op1, op2);
+      pat = GEN_FCN5 (d->icode) (scratch0, target, op0, op1, op2);
     }
   else
     {
@@ -28577,7 +28577,7 @@ ix86_expand_sse_pcmpistr (const struct b
       scratch0 = gen_reg_rtx (tmode0);
       scratch1 = gen_reg_rtx (tmode1);
 
-      pat = GEN_FCN (d->icode) (scratch0, scratch1, op0, op1, op2);
+      pat = GEN_FCN5 (d->icode) (scratch0, scratch1, op0, op1, op2);
     }
 
   if (! pat)
@@ -29048,17 +29048,17 @@ ix86_expand_args_builtin (const struct b
   switch (nargs)
     {
     case 1:
-      pat = GEN_FCN (icode) (real_target, args[0].op);
+      pat = GEN_FCN2 (icode) (real_target, args[0].op);
       break;
     case 2:
-      pat = GEN_FCN (icode) (real_target, args[0].op, args[1].op);
+      pat = GEN_FCN3 (icode) (real_target, args[0].op, args[1].op);
       break;
     case 3:
-      pat = GEN_FCN (icode) (real_target, args[0].op, args[1].op,
+      pat = GEN_FCN4 (icode) (real_target, args[0].op, args[1].op,
 			     args[2].op);
       break;
     case 4:
-      pat = GEN_FCN (icode) (real_target, args[0].op, args[1].op,
+      pat = GEN_FCN5 (icode) (real_target, args[0].op, args[1].op,
 			     args[2].op, args[3].op);
       break;
     default:
@@ -29098,7 +29098,7 @@ ix86_expand_special_args_builtin (const
     case VOID_FTYPE_VOID:
       if (icode == CODE_FOR_avx_vzeroupper)
 	target = GEN_INT (vzeroupper_intrinsic);
-      emit_insn (GEN_FCN (icode) (target));
+      emit_insn (GEN_FCN1 (icode) (target));
       return 0;
     case VOID_FTYPE_UINT64:
     case VOID_FTYPE_UNSIGNED:
@@ -29269,16 +29269,16 @@ ix86_expand_special_args_builtin (const
   switch (nargs)
     {
     case 0:
-      pat = GEN_FCN (icode) (target);
+      pat = GEN_FCN1 (icode) (target);
       break;
     case 1:
-      pat = GEN_FCN (icode) (target, args[0].op);
+      pat = GEN_FCN2 (icode) (target, args[0].op);
       break;
     case 2:
-      pat = GEN_FCN (icode) (target, args[0].op, args[1].op);
+      pat = GEN_FCN3 (icode) (target, args[0].op, args[1].op);
       break;
     case 3:
-      pat = GEN_FCN (icode) (target, args[0].op, args[1].op, args[2].op);
+      pat = GEN_FCN4 (icode) (target, args[0].op, args[1].op, args[2].op);
       break;
     default:
       gcc_unreachable ();
@@ -29482,7 +29482,7 @@ ix86_expand_builtin (tree exp, rtx targe
 	op1 = copy_to_mode_reg (mode1, op1);
       if (!insn_data[icode].operand[2].predicate (op2, mode2))
 	op2 = copy_to_mode_reg (mode2, op2);
-      pat = GEN_FCN (icode) (op0, op1, op2);
+      pat = GEN_FCN3 (icode) (op0, op1, op2);
       if (! pat)
 	return 0;
       emit_insn (pat);
@@ -29628,7 +29628,7 @@ ix86_expand_builtin (tree exp, rtx targe
           unsigned char lsb_index = INTVAL (op1) & 0xFF;
           op1 = GEN_INT (length);
           op2 = GEN_INT (lsb_index);
-          pat = GEN_FCN (icode) (target, op0, op1, op2);
+          pat = GEN_FCN4 (icode) (target, op0, op1, op2);
           if (pat)
             emit_insn (pat);
           return target;
@@ -29650,7 +29650,7 @@ ix86_expand_builtin (tree exp, rtx targe
 
 rdrand_step:
       op0 = gen_reg_rtx (mode0);
-      emit_insn (GEN_FCN (icode) (op0));
+      emit_insn (GEN_FCN1 (icode) (op0));
 
       arg0 = CALL_EXPR_ARG (exp, 0);
       op1 = expand_normal (arg0);
@@ -29881,7 +29881,7 @@ rdrand_step:
 	    }
 	}
 
-      pat = GEN_FCN (icode) (subtarget, op0, op1, op2, op3, op4);
+      pat = GEN_FCN6 (icode) (subtarget, op0, op1, op2, op3, op4);
       if (! pat)
 	return const0_rtx;
       emit_insn (pat);
--- gcc-4.7.3/gcc/config/ia64/ia64.c.~1~	2012-12-04 10:07:45.000000000 +0100
+++ gcc-4.7.3/gcc/config/ia64/ia64.c	2013-05-25 10:45:12.443139273 +0200
@@ -2401,7 +2401,7 @@ ia64_expand_atomic_op (enum rtx_code cod
 	  gcc_unreachable ();
 	}
 
-      emit_insn (GEN_FCN (icode) (old_dst, mem, val));
+      emit_insn (GEN_FCN3 (icode) (old_dst, mem, val));
 
       if (new_dst)
 	{
@@ -2492,7 +2492,7 @@ ia64_expand_atomic_op (enum rtx_code cod
       gcc_unreachable ();
     }
 
-  emit_insn (GEN_FCN (icode) (cmp_reg, mem, ar_ccv, new_reg));
+  emit_insn (GEN_FCN4 (icode) (cmp_reg, mem, ar_ccv, new_reg));
 
   emit_cmp_and_jump_insns (cmp_reg, old_reg, NE, NULL, DImode, true, label);
 }
--- gcc-4.7.3/gcc/config/iq2000/iq2000.c.~1~	2012-08-06 16:34:27.000000000 +0200
+++ gcc-4.7.3/gcc/config/iq2000/iq2000.c	2013-05-25 10:45:12.443139273 +0200
@@ -2610,30 +2610,30 @@ expand_one_builtin (enum insn_code icode
   switch (argcount)
     {
     case 0:
-	pat = GEN_FCN (icode) (target);
+	pat = GEN_FCN1 (icode) (target);
     case 1:
       if (target)
-	pat = GEN_FCN (icode) (target, op[0]);
+	pat = GEN_FCN2 (icode) (target, op[0]);
       else
-	pat = GEN_FCN (icode) (op[0]);
+	pat = GEN_FCN1 (icode) (op[0]);
       break;
     case 2:
       if (target)
-	pat = GEN_FCN (icode) (target, op[0], op[1]);
+	pat = GEN_FCN3 (icode) (target, op[0], op[1]);
       else
-	pat = GEN_FCN (icode) (op[0], op[1]);
+	pat = GEN_FCN2 (icode) (op[0], op[1]);
       break;
     case 3:
       if (target)
-	pat = GEN_FCN (icode) (target, op[0], op[1], op[2]);
+	pat = GEN_FCN4 (icode) (target, op[0], op[1], op[2]);
       else
-	pat = GEN_FCN (icode) (op[0], op[1], op[2]);
+	pat = GEN_FCN3 (icode) (op[0], op[1], op[2]);
       break;
     case 4:
       if (target)
-	pat = GEN_FCN (icode) (target, op[0], op[1], op[2], op[3]);
+	pat = GEN_FCN5 (icode) (target, op[0], op[1], op[2], op[3]);
       else
-	pat = GEN_FCN (icode) (op[0], op[1], op[2], op[3]);
+	pat = GEN_FCN4 (icode) (op[0], op[1], op[2], op[3]);
       break;
     default:
       gcc_unreachable ();
--- gcc-4.7.3/gcc/config/mep/mep.c.~1~	2011-08-18 14:37:53.000000000 +0200
+++ gcc-4.7.3/gcc/config/mep/mep.c	2013-05-25 10:45:12.443139273 +0200
@@ -6451,8 +6451,8 @@ mep_expand_builtin (tree exp, rtx target
     }
 
   /* Emit the instruction.  */
-  pat = idata->genfun (op[0], op[1], op[2], op[3], op[4],
-		       op[5], op[6], op[7], op[8], op[9]);
+  pat = idata->genfun.argc10 (op[0], op[1], op[2], op[3], op[4],
+			      op[5], op[6], op[7], op[8], op[9]);
 
   if (GET_CODE (pat) == SET
       && GET_CODE (SET_DEST (pat)) == PC
@@ -7222,9 +7222,9 @@ mep_emit_intrinsic (int intrinsic, const
 	return false;
     }
 
-  emit_insn (idata->genfun (newop[0], newop[1], newop[2],
-			    newop[3], newop[4], newop[5],
-			    newop[6], newop[7], newop[8]));
+  emit_insn (idata->genfun.argc9 (newop[0], newop[1], newop[2],
+				  newop[3], newop[4], newop[5],
+				  newop[6], newop[7], newop[8]));
 
   return true;
 }
--- gcc-4.7.3/gcc/config/picochip/picochip.c.~1~	2011-08-18 14:37:53.000000000 +0200
+++ gcc-4.7.3/gcc/config/picochip/picochip.c	2013-05-25 10:45:12.443139273 +0200
@@ -56,7 +56,7 @@ along with GCC; see the file COPYING3.
 #include "insn-attr.h"		/* For DFA state_t. */
 #include "insn-config.h"	/* Required by recog.h */
 #include "insn-codes.h"		/* For CODE_FOR_? */
-#include "optabs.h"		/* For GEN_FCN */
+#include "optabs.h"		/* For GEN_FCN? */
 #include "basic-block.h"	/* UPDATE_LIFE_GLOBAL* for picochip_reorg. */
 #include "timevar.h"		/* For TV_SCHED2, in picochip_reorg. */
 #include "libfuncs.h"		/* For memcpy_libfuncs, etc. */
@@ -3944,7 +3944,7 @@ picochip_expand_builtin_2op (enum insn_c
     target = gen_reg_rtx (tmode);
 
   /* Emit and return the new instruction. */
-  pat = GEN_FCN (icode) (target, op0);
+  pat = GEN_FCN2 (icode) (target, op0);
   if (!pat)
     return 0;
   emit_insn (pat);
@@ -3989,7 +3989,7 @@ picochip_expand_builtin_3op (enum insn_c
     target = gen_reg_rtx (tmode);
 
   /* Emit and return the new instruction. */
-  pat = GEN_FCN (icode) (target, op0, op1);
+  pat = GEN_FCN3 (icode) (target, op0, op1);
   if (!pat)
     return 0;
   emit_insn (pat);
@@ -4026,7 +4026,7 @@ picochip_expand_builtin_2opvoid (enum in
     op1 = copy_to_mode_reg (mode1, op1);
 
   /* Emit and return the new instruction. */
-  pat = GEN_FCN (icode) (op0, op1);
+  pat = GEN_FCN2 (icode) (op0, op1);
   if (!pat)
     return 0;
   emit_insn (pat);
--- gcc-4.7.3/gcc/config/rs6000/rs6000.c.~1~	2013-02-08 20:46:52.000000000 +0100
+++ gcc-4.7.3/gcc/config/rs6000/rs6000.c	2013-05-25 10:45:12.453139261 +0200
@@ -9846,7 +9846,7 @@ rs6000_expand_unop_builtin (enum insn_co
   if (! (*insn_data[icode].operand[1].predicate) (op0, mode0))
     op0 = copy_to_mode_reg (mode0, op0);
 
-  pat = GEN_FCN (icode) (target, op0);
+  pat = GEN_FCN2 (icode) (target, op0);
   if (! pat)
     return 0;
   emit_insn (pat);
@@ -9878,7 +9878,7 @@ altivec_expand_abs_builtin (enum insn_co
   scratch1 = gen_reg_rtx (mode0);
   scratch2 = gen_reg_rtx (mode0);
 
-  pat = GEN_FCN (icode) (target, op0, scratch1, scratch2);
+  pat = GEN_FCN4 (icode) (target, op0, scratch1, scratch2);
   if (! pat)
     return 0;
   emit_insn (pat);
@@ -9951,7 +9951,7 @@ rs6000_expand_binop_builtin (enum insn_c
   if (! (*insn_data[icode].operand[2].predicate) (op1, mode1))
     op1 = copy_to_mode_reg (mode1, op1);
 
-  pat = GEN_FCN (icode) (target, op0, op1);
+  pat = GEN_FCN3 (icode) (target, op0, op1);
   if (! pat)
     return 0;
   emit_insn (pat);
@@ -9999,7 +9999,7 @@ altivec_expand_predicate_builtin (enum i
 
   scratch = gen_reg_rtx (mode0);
 
-  pat = GEN_FCN (icode) (scratch, op0, op1);
+  pat = GEN_FCN3 (icode) (scratch, op0, op1);
   if (! pat)
     return 0;
   emit_insn (pat);
@@ -10071,7 +10071,7 @@ paired_expand_lv_builtin (enum insn_code
       addr = gen_rtx_MEM (tmode, gen_rtx_PLUS (Pmode, op0, op1));
     }
 
-  pat = GEN_FCN (icode) (target, addr);
+  pat = GEN_FCN2 (icode) (target, addr);
 
   if (! pat)
     return 0;
@@ -10117,7 +10117,7 @@ altivec_expand_lv_builtin (enum insn_cod
       addr = gen_rtx_MEM (blk ? BLKmode : tmode, gen_rtx_PLUS (Pmode, op0, op1));
     }
 
-  pat = GEN_FCN (icode) (target, addr);
+  pat = GEN_FCN2 (icode) (target, addr);
 
   if (! pat)
     return 0;
@@ -10153,7 +10153,7 @@ spe_expand_stv_builtin (enum insn_code i
   if (! (*insn_data[icode].operand[1].predicate) (op2, mode1))
     op2 = copy_to_mode_reg (mode1, op2);
 
-  pat = GEN_FCN (icode) (op1, op2, op0);
+  pat = GEN_FCN3 (icode) (op1, op2, op0);
   if (pat)
     emit_insn (pat);
   return NULL_RTX;
@@ -10194,7 +10194,7 @@ paired_expand_stv_builtin (enum insn_cod
       addr = gen_rtx_MEM (tmode, gen_rtx_PLUS (Pmode, op1, op2));
     }
 
-  pat = GEN_FCN (icode) (addr, op0);
+  pat = GEN_FCN2 (icode) (addr, op0);
   if (pat)
     emit_insn (pat);
   return NULL_RTX;
@@ -10236,7 +10236,7 @@ altivec_expand_stv_builtin (enum insn_co
       addr = gen_rtx_MEM (tmode, gen_rtx_PLUS (Pmode, op1, op2));
     }
 
-  pat = GEN_FCN (icode) (addr, op0);
+  pat = GEN_FCN2 (icode) (addr, op0);
   if (pat)
     emit_insn (pat);
   return NULL_RTX;
@@ -10332,9 +10332,9 @@ rs6000_expand_ternop_builtin (enum insn_
     op2 = copy_to_mode_reg (mode2, op2);
 
   if (TARGET_PAIRED_FLOAT && icode == CODE_FOR_selv2sf4)
-    pat = GEN_FCN (icode) (target, op0, op1, op2, CONST0_RTX (SFmode));
+    pat = GEN_FCN5 (icode) (target, op0, op1, op2, CONST0_RTX (SFmode));
   else 
-    pat = GEN_FCN (icode) (target, op0, op1, op2);
+    pat = GEN_FCN4 (icode) (target, op0, op1, op2);
   if (! pat)
     return 0;
   emit_insn (pat);
@@ -10393,7 +10393,7 @@ altivec_expand_ld_builtin (tree exp, rtx
   if (! (*insn_data[icode].operand[1].predicate) (op0, mode0))
     op0 = gen_rtx_MEM (mode0, copy_to_mode_reg (Pmode, op0));
 
-  pat = GEN_FCN (icode) (target, op0);
+  pat = GEN_FCN2 (icode) (target, op0);
   if (! pat)
     return 0;
   emit_insn (pat);
@@ -10449,7 +10449,7 @@ altivec_expand_st_builtin (tree exp, rtx
   if (! (*insn_data[icode].operand[1].predicate) (op1, mode1))
     op1 = copy_to_mode_reg (mode1, op1);
 
-  pat = GEN_FCN (icode) (op0, op1);
+  pat = GEN_FCN2 (icode) (op0, op1);
   if (pat)
     emit_insn (pat);
 
@@ -10506,7 +10506,7 @@ altivec_expand_dst_builtin (tree exp, rt
 	if (! (*insn_data[d->icode].operand[1].predicate) (op1, mode1))
 	  op1 = copy_to_mode_reg (mode1, op1);
 
-	pat = GEN_FCN (d->icode) (op0, op1, op2);
+	pat = GEN_FCN3 (d->icode) (op0, op1, op2);
 	if (pat != 0)
 	  emit_insn (pat);
 
@@ -10702,7 +10702,7 @@ altivec_expand_builtin (tree exp, rtx ta
 	  || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
 	target = gen_reg_rtx (tmode);
 
-      pat = GEN_FCN (icode) (target);
+      pat = GEN_FCN1 (icode) (target);
       if (! pat)
 	return 0;
       emit_insn (pat);
@@ -10721,7 +10721,7 @@ altivec_expand_builtin (tree exp, rtx ta
       if (! (*insn_data[icode].operand[0].predicate) (op0, mode0))
 	op0 = copy_to_mode_reg (mode0, op0);
 
-      pat = GEN_FCN (icode) (op0);
+      pat = GEN_FCN1 (icode) (op0);
       if (pat)
 	emit_insn (pat);
       return NULL_RTX;
@@ -11028,7 +11028,7 @@ spe_expand_builtin (tree exp, rtx target
 	  || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
 	target = gen_reg_rtx (tmode);
 
-      pat = GEN_FCN (icode) (target);
+      pat = GEN_FCN1 (icode) (target);
       if (! pat)
 	return 0;
       emit_insn (pat);
@@ -11045,7 +11045,7 @@ spe_expand_builtin (tree exp, rtx target
       if (! (*insn_data[icode].operand[0].predicate) (op0, mode0))
 	op0 = copy_to_mode_reg (mode0, op0);
 
-      pat = GEN_FCN (icode) (op0);
+      pat = GEN_FCN1 (icode) (op0);
       if (pat)
 	emit_insn (pat);
       return NULL_RTX;
@@ -11095,7 +11095,7 @@ paired_expand_predicate_builtin (enum in
 
   scratch = gen_reg_rtx (CCFPmode);
 
-  pat = GEN_FCN (icode) (scratch, op0, op1);
+  pat = GEN_FCN3 (icode) (scratch, op0, op1);
   if (!pat)
     return const0_rtx;
 
@@ -11168,7 +11168,7 @@ spe_expand_predicate_builtin (enum insn_
 
   scratch = gen_reg_rtx (CCmode);
 
-  pat = GEN_FCN (icode) (scratch, op0, op1);
+  pat = GEN_FCN3 (icode) (scratch, op0, op1);
   if (! pat)
     return const0_rtx;
   emit_insn (pat);
@@ -11274,7 +11274,7 @@ spe_expand_evsel_builtin (enum insn_code
 
   /* Generate the compare.  */
   scratch = gen_reg_rtx (CCmode);
-  pat = GEN_FCN (icode) (scratch, op0, op1);
+  pat = GEN_FCN3 (icode) (scratch, op0, op1);
   if (! pat)
     return const0_rtx;
   emit_insn (pat);
@@ -11428,7 +11428,7 @@ rs6000_expand_builtin (tree exp, rtx tar
 	  target = gen_reg_rtx (tmode);
 
 	/*pat = gen_altivec_lvsr (target, op);*/
-	pat = GEN_FCN (icode) (target, op);
+	pat = GEN_FCN2 (icode) (target, op);
 	if (!pat)
 	  return 0;
 	emit_insn (pat);
@@ -16194,7 +16194,7 @@ rs6000_emit_vector_compare (enum rtx_cod
 	  return NULL_RTX;
 
 	mask = gen_reg_rtx (dmode);
-	emit_insn (GEN_FCN (nor_code) (mask, mask2));
+	emit_insn (GEN_FCN2 (nor_code) (mask, mask2));
 	return mask;
       }
       break;
@@ -16243,7 +16243,7 @@ rs6000_emit_vector_compare (enum rtx_cod
 	  return NULL_RTX;
 
 	mask = gen_reg_rtx (dmode);
-	emit_insn (GEN_FCN (ior_code) (mask, c_rtx, eq_rtx));
+	emit_insn (GEN_FCN3 (ior_code) (mask, c_rtx, eq_rtx));
 	return mask;
       }
       break;
@@ -26051,7 +26051,7 @@ rs6000_emit_swdiv_low_precision (rtx dst
   enum machine_mode mode = GET_MODE (dst);
   rtx x0, e0, e1, e2, y1, y2, y3, u0, v0, one;
   enum insn_code code = optab_handler (smul_optab, mode);
-  gen_2arg_fn_t gen_mul = (gen_2arg_fn_t) GEN_FCN (code);
+  gen_2arg_fn_t gen_mul = (gen_2arg_fn_t) GEN_FCN3 (code);
 
   gcc_assert (code != CODE_FOR_nothing);
 
@@ -26122,7 +26122,7 @@ rs6000_emit_swrsqrt (rtx dst, rtx src)
   int i;
   rtx halfthree;
   enum insn_code code = optab_handler (smul_optab, mode);
-  gen_2arg_fn_t gen_mul = (gen_2arg_fn_t) GEN_FCN (code);
+  gen_2arg_fn_t gen_mul = (gen_2arg_fn_t) GEN_FCN3 (code);
 
   gcc_assert (code != CODE_FOR_nothing);
 
@@ -26439,7 +26439,7 @@ altivec_expand_vec_perm_const (rtx opera
 	    x = target;
 	  else
 	    x = gen_reg_rtx (omode);
-	  emit_insn (GEN_FCN (icode) (x, op0, op1));
+	  emit_insn (GEN_FCN3 (icode) (x, op0, op1));
 	  if (omode != V16QImode)
 	    emit_move_insn (target, gen_lowpart (V16QImode, x));
 	  return true;
--- gcc-4.7.3/gcc/config/sh/sh.c.~1~	2013-03-25 23:55:56.000000000 +0100
+++ gcc-4.7.3/gcc/config/sh/sh.c	2013-05-25 10:45:12.453139261 +0200
@@ -11279,16 +11279,16 @@ sh_expand_builtin (tree exp, rtx target,
   switch (nop)
     {
     case 1:
-      pat = (*insn_data[d->icode].genfun) (op[0]);
+      pat = GEN_FCN1 (d->icode) (op[0]);
       break;
     case 2:
-      pat = (*insn_data[d->icode].genfun) (op[0], op[1]);
+      pat = GEN_FCN2 (d->icode) (op[0], op[1]);
       break;
     case 3:
-      pat = (*insn_data[d->icode].genfun) (op[0], op[1], op[2]);
+      pat = GEN_FCN3 (d->icode) (op[0], op[1], op[2]);
       break;
     case 4:
-      pat = (*insn_data[d->icode].genfun) (op[0], op[1], op[2], op[3]);
+      pat = GEN_FCN4 (d->icode) (op[0], op[1], op[2], op[3]);
       break;
     default:
       gcc_unreachable ();
--- gcc-4.7.3/gcc/config/sparc/sparc.c.~1~	2012-12-16 11:26:08.000000000 +0100
+++ gcc-4.7.3/gcc/config/sparc/sparc.c	2013-05-25 10:45:12.453139261 +0200
@@ -9877,19 +9877,19 @@ sparc_expand_builtin (tree exp, rtx targ
   switch (arg_count)
     {
     case 0:
-      pat = GEN_FCN (icode) (op[0]);
+      pat = GEN_FCN1 (icode) (op[0]);
       break;
     case 1:
       if (nonvoid)
-	pat = GEN_FCN (icode) (op[0], op[1]);
+	pat = GEN_FCN2 (icode) (op[0], op[1]);
       else
-	pat = GEN_FCN (icode) (op[1]);
+	pat = GEN_FCN1 (icode) (op[1]);
       break;
     case 2:
-      pat = GEN_FCN (icode) (op[0], op[1], op[2]);
+      pat = GEN_FCN3 (icode) (op[0], op[1], op[2]);
       break;
     case 3:
-      pat = GEN_FCN (icode) (op[0], op[1], op[2], op[3]);
+      pat = GEN_FCN4 (icode) (op[0], op[1], op[2], op[3]);
       break;
     default:
       gcc_unreachable ();
--- gcc-4.7.3/gcc/config/spu/spu.c.~1~	2012-02-10 17:38:37.000000000 +0100
+++ gcc-4.7.3/gcc/config/spu/spu.c	2013-05-25 10:45:12.453139261 +0200
@@ -1175,7 +1175,7 @@ spu_emit_branch_or_set (int is_set, rtx
       if (!(*insn_data[spu_comp_icode[index][scode]].operand[2].predicate)
 	  (op1, op_mode))
 	op1 = force_reg (op_mode, op1);
-      comp_rtx = GEN_FCN (spu_comp_icode[index][scode]) (compare_result,
+      comp_rtx = GEN_FCN3 (spu_comp_icode[index][scode]) (compare_result,
 							 op0, op1);
       if (comp_rtx == 0)
 	abort ();
@@ -1184,14 +1184,14 @@ spu_emit_branch_or_set (int is_set, rtx
       if (eq_test)
         {
           eq_result = gen_reg_rtx (comp_mode);
-          eq_rtx = GEN_FCN (spu_comp_icode[index][eq_code]) (eq_result,
+          eq_rtx = GEN_FCN3 (spu_comp_icode[index][eq_code]) (eq_result,
 							     op0, op1);
           if (eq_rtx == 0)
 	    abort ();
           emit_insn (eq_rtx);
           ior_code = optab_handler (ior_optab, comp_mode);
           gcc_assert (ior_code != CODE_FOR_nothing);
-          emit_insn (GEN_FCN (ior_code)
+          emit_insn (GEN_FCN3 (ior_code)
 		     (compare_result, compare_result, eq_result));
         }
     }
@@ -4736,7 +4736,7 @@ spu_expand_mov (rtx * ops, enum machine_
 	{
 	  enum insn_code icode = convert_optab_handler (trunc_optab,
 							mode, imode);
-	  emit_insn (GEN_FCN (icode) (ops[0], from));
+	  emit_insn (GEN_FCN2 (icode) (ops[0], from));
 	}
       else
 	emit_insn (gen_extend_insn (ops[0], from, mode, imode, 1));
@@ -6428,7 +6428,7 @@ spu_emit_vector_compare (enum rtx_code r
 
             nor_code = optab_handler (one_cmpl_optab, dest_mode);
             gcc_assert (nor_code != CODE_FOR_nothing);
-            emit_insn (GEN_FCN (nor_code) (mask, rev_mask));
+            emit_insn (GEN_FCN2 (nor_code) (mask, rev_mask));
             if (dmode != dest_mode)
               {
                 rtx temp = gen_reg_rtx (dest_mode);
@@ -6463,7 +6463,7 @@ spu_emit_vector_compare (enum rtx_code r
 
             ior_code = optab_handler (ior_optab, dest_mode);
             gcc_assert (ior_code != CODE_FOR_nothing);
-            emit_insn (GEN_FCN (ior_code) (mask, c_rtx, eq_rtx));
+            emit_insn (GEN_FCN3 (ior_code) (mask, c_rtx, eq_rtx));
             if (dmode != dest_mode)
               {
                 rtx temp = gen_reg_rtx (dest_mode);
@@ -6484,7 +6484,7 @@ spu_emit_vector_compare (enum rtx_code r
 
             ior_code = optab_handler (ior_optab, dest_mode);
             gcc_assert (ior_code != CODE_FOR_nothing);
-            emit_insn (GEN_FCN (ior_code) (mask, lt_rtx, gt_rtx));
+            emit_insn (GEN_FCN3 (ior_code) (mask, lt_rtx, gt_rtx));
             if (dmode != dest_mode)
               {
                 rtx temp = gen_reg_rtx (dest_mode);
@@ -6505,7 +6505,7 @@ spu_emit_vector_compare (enum rtx_code r
 
             and_code = optab_handler (and_optab, dest_mode);
             gcc_assert (and_code != CODE_FOR_nothing);
-            emit_insn (GEN_FCN (and_code) (mask, a_rtx, b_rtx));
+            emit_insn (GEN_FCN3 (and_code) (mask, a_rtx, b_rtx));
             if (dmode != dest_mode)
               {
                 rtx temp = gen_reg_rtx (dest_mode);
@@ -6534,7 +6534,7 @@ spu_emit_vector_compare (enum rtx_code r
         }
     }
 
-  emit_insn (GEN_FCN (vec_cmp_insn) (mask, op0, op1));
+  emit_insn (GEN_FCN3 (vec_cmp_insn) (mask, op0, op1));
   if (dmode != dest_mode)
     {
       rtx temp = gen_reg_rtx (dest_mode);
@@ -6738,7 +6738,7 @@ spu_expand_builtin_1 (struct spu_builtin
                  gen_rtx_NEG (GET_MODE (addr), addr)));
       op = gen_rtx_MEM (mode, op);
 
-      pat = GEN_FCN (icode) (target, op);
+      pat = GEN_FCN2 (icode) (target, op);
       if (!pat) 
         return 0;
       emit_insn (pat);
@@ -6794,25 +6794,25 @@ spu_expand_builtin_1 (struct spu_builtin
   switch (n_operands)
     {
     case 0:
-      pat = GEN_FCN (icode) (0);
+      pat = GEN_FCN0 (icode) ();
       break;
     case 1:
-      pat = GEN_FCN (icode) (ops[0]);
+      pat = GEN_FCN1 (icode) (ops[0]);
       break;
     case 2:
-      pat = GEN_FCN (icode) (ops[0], ops[1]);
+      pat = GEN_FCN2 (icode) (ops[0], ops[1]);
       break;
     case 3:
-      pat = GEN_FCN (icode) (ops[0], ops[1], ops[2]);
+      pat = GEN_FCN3 (icode) (ops[0], ops[1], ops[2]);
       break;
     case 4:
-      pat = GEN_FCN (icode) (ops[0], ops[1], ops[2], ops[3]);
+      pat = GEN_FCN4 (icode) (ops[0], ops[1], ops[2], ops[3]);
       break;
     case 5:
-      pat = GEN_FCN (icode) (ops[0], ops[1], ops[2], ops[3], ops[4]);
+      pat = GEN_FCN5 (icode) (ops[0], ops[1], ops[2], ops[3], ops[4]);
       break;
     case 6:
-      pat = GEN_FCN (icode) (ops[0], ops[1], ops[2], ops[3], ops[4], ops[5]);
+      pat = GEN_FCN6 (icode) (ops[0], ops[1], ops[2], ops[3], ops[4], ops[5]);
       break;
     default:
       abort ();
--- gcc-4.7.3/gcc/config/stormy16/stormy16.c.~1~	2012-08-06 16:34:27.000000000 +0200
+++ gcc-4.7.3/gcc/config/stormy16/stormy16.c	2013-05-25 10:45:12.453139261 +0200
@@ -2347,8 +2347,8 @@ xstormy16_expand_builtin (tree exp, rtx
 	retval = op[o];
     }
 
-  pat = GEN_FCN (code) (op[0], op[1], op[2], op[3], op[4],
-			op[5], op[6], op[7], op[8], op[9]);
+  pat = GEN_FCN10 (code) (op[0], op[1], op[2], op[3], op[4],
+			  op[5], op[6], op[7], op[8], op[9]);
   emit_insn (pat);
 
   for (o = 0; s16builtins[i].arg_ops[o]; o++)
--- gcc-4.7.3/gcc/config/tilegx/tilegx.c.~1~	2013-03-27 07:39:01.000000000 +0100
+++ gcc-4.7.3/gcc/config/tilegx/tilegx.c	2013-05-25 10:45:12.453139261 +0200
@@ -1987,7 +1987,7 @@ tilegx_expand_constant_multiply_given_se
 	  gcc_assert (shift_count > 0 && shift_count < 64);
 
 	  /* Emit the actual instruction.  */
-	  emit_insn (GEN_FCN (opcode)
+	  emit_insn (GEN_FCN3 (opcode)
 		     (out, subexprs[entry->lhs],
 		      gen_rtx_CONST_INT (DImode, shift_count)));
 	}
@@ -2001,7 +2001,7 @@ tilegx_expand_constant_multiply_given_se
 	  gcc_assert (entry->rhs < num_subexprs);
 
 	  /* Emit the actual instruction.  */
-	  emit_insn (GEN_FCN (opcode)
+	  emit_insn (GEN_FCN3 (opcode)
 		     (out, subexprs[entry->lhs], subexprs[entry->rhs]));
 	}
 
@@ -3393,7 +3393,6 @@ tilegx_expand_builtin (tree exp,
   rtx op[MAX_BUILTIN_ARGS + 1], pat;
   int opnum;
   bool nonvoid;
-  insn_gen_fn fn;
 
   if (fcode >= TILEGX_BUILTIN_max)
     internal_error ("bad builtin fcode");
@@ -3464,26 +3463,25 @@ tilegx_expand_builtin (tree exp,
       op[0] = target;
     }
 
-  fn = GEN_FCN (icode);
   switch (opnum)
     {
     case 0:
-      pat = fn (NULL_RTX);
+      pat = GEN_FCN0 (icode) ();
       break;
     case 1:
-      pat = fn (op[0]);
+      pat = GEN_FCN1 (icode) (op[0]);
       break;
     case 2:
-      pat = fn (op[0], op[1]);
+      pat = GEN_FCN2 (icode) (op[0], op[1]);
       break;
     case 3:
-      pat = fn (op[0], op[1], op[2]);
+      pat = GEN_FCN3 (icode) (op[0], op[1], op[2]);
       break;
     case 4:
-      pat = fn (op[0], op[1], op[2], op[3]);
+      pat = GEN_FCN4 (icode) (op[0], op[1], op[2], op[3]);
       break;
     case 5:
-      pat = fn (op[0], op[1], op[2], op[3], op[4]);
+      pat = GEN_FCN5 (icode) (op[0], op[1], op[2], op[3], op[4]);
       break;
     default:
       gcc_unreachable ();
--- gcc-4.7.3/gcc/config/tilepro/tilepro.c.~1~	2013-03-26 07:27:55.000000000 +0100
+++ gcc-4.7.3/gcc/config/tilepro/tilepro.c	2013-05-25 10:45:12.453139261 +0200
@@ -1895,7 +1895,7 @@ tilepro_expand_constant_multiply_given_s
 	  gcc_assert (shift_count > 0 && shift_count < 32);
 
 	  /* Emit the actual instruction.  */
-	  emit_insn (GEN_FCN (opcode)
+	  emit_insn (GEN_FCN3 (opcode)
 		     (out, subexprs[entry->lhs],
 		      gen_rtx_CONST_INT (SImode, shift_count)));
 	}
@@ -1909,7 +1909,7 @@ tilepro_expand_constant_multiply_given_s
 	  gcc_assert (entry->rhs < num_subexprs);
 
 	  /* Emit the actual instruction.  */
-	  emit_insn (GEN_FCN (opcode)
+	  emit_insn (GEN_FCN3 (opcode)
 		     (out, subexprs[entry->lhs], subexprs[entry->rhs]));
 	}
 
@@ -3092,7 +3092,6 @@ tilepro_expand_builtin (tree exp,
   rtx op[MAX_BUILTIN_ARGS + 1], pat;
   int opnum;
   bool nonvoid;
-  insn_gen_fn fn;
 
   if (fcode >= TILEPRO_BUILTIN_max)
     internal_error ("bad builtin fcode");
@@ -3141,26 +3140,25 @@ tilepro_expand_builtin (tree exp,
       op[0] = target;
     }
 
-  fn = GEN_FCN (icode);
   switch (opnum)
     {
     case 0:
-      pat = fn (NULL_RTX);
+      pat = GEN_FCN0 ();
       break;
     case 1:
-      pat = fn (op[0]);
+      pat = GEN_FCN1 (op[0]);
       break;
     case 2:
-      pat = fn (op[0], op[1]);
+      pat = GEN_FCN2 (op[0], op[1]);
       break;
     case 3:
-      pat = fn (op[0], op[1], op[2]);
+      pat = GEN_FCN3 (op[0], op[1], op[2]);
       break;
     case 4:
-      pat = fn (op[0], op[1], op[2], op[3]);
+      pat = GEN_FCN4 (op[0], op[1], op[2], op[3]);
       break;
     case 5:
-      pat = fn (op[0], op[1], op[2], op[3], op[4]);
+      pat = GEN_FCN5 (op[0], op[1], op[2], op[3], op[4]);
       break;
     default:
       gcc_unreachable ();
--- gcc-4.7.3/gcc/expr.c.~1~	2013-02-01 15:10:48.000000000 +0100
+++ gcc-4.7.3/gcc/expr.c	2013-05-25 10:45:12.453139261 +0200
@@ -123,7 +123,7 @@ struct store_by_pieces_d
   int reverse;
 };
 
-static void move_by_pieces_1 (rtx (*) (rtx, ...), enum machine_mode,
+static void move_by_pieces_1 (rtx (*) (rtx, rtx), enum machine_mode,
 			      struct move_by_pieces_d *);
 static bool block_move_libcall_safe_for_call_parm (void);
 static bool emit_block_move_via_movmem (rtx, rtx, rtx, unsigned, unsigned, HOST_WIDE_INT);
@@ -132,7 +132,7 @@ static void emit_block_move_via_loop (rt
 static rtx clear_by_pieces_1 (void *, HOST_WIDE_INT, enum machine_mode);
 static void clear_by_pieces (rtx, unsigned HOST_WIDE_INT, unsigned int);
 static void store_by_pieces_1 (struct store_by_pieces_d *, unsigned int);
-static void store_by_pieces_2 (rtx (*) (rtx, ...), enum machine_mode,
+static void store_by_pieces_2 (rtx (*) (rtx, rtx), enum machine_mode,
 			       struct store_by_pieces_d *);
 static tree clear_storage_libcall_fn (int);
 static rtx compress_float_constant (rtx, rtx);
@@ -971,7 +971,7 @@ move_by_pieces (rtx to, rtx from, unsign
 
       icode = optab_handler (mov_optab, mode);
       if (icode != CODE_FOR_nothing && align >= GET_MODE_ALIGNMENT (mode))
-	move_by_pieces_1 (GEN_FCN (icode), mode, &data);
+	move_by_pieces_1 (GEN_FCN2 (icode), mode, &data);
 
       max_size = GET_MODE_SIZE (mode);
     }
@@ -1047,7 +1047,7 @@ move_by_pieces_ninsns (unsigned HOST_WID
    to make a move insn for that mode.  DATA has all the other info.  */
 
 static void
-move_by_pieces_1 (rtx (*genfun) (rtx, ...), enum machine_mode mode,
+move_by_pieces_1 (rtx (*genfun) (rtx, rtx), enum machine_mode mode,
 		  struct move_by_pieces_d *data)
 {
   unsigned int size = GET_MODE_SIZE (mode);
@@ -2594,7 +2594,7 @@ store_by_pieces_1 (struct store_by_piece
 
       icode = optab_handler (mov_optab, mode);
       if (icode != CODE_FOR_nothing && align >= GET_MODE_ALIGNMENT (mode))
-	store_by_pieces_2 (GEN_FCN (icode), mode, data);
+	store_by_pieces_2 (GEN_FCN2 (icode), mode, data);
 
       max_size = GET_MODE_SIZE (mode);
     }
@@ -2608,7 +2608,7 @@ store_by_pieces_1 (struct store_by_piece
    to make a move insn for that mode.  DATA has all the other info.  */
 
 static void
-store_by_pieces_2 (rtx (*genfun) (rtx, ...), enum machine_mode mode,
+store_by_pieces_2 (rtx (*genfun) (rtx, rtx), enum machine_mode mode,
 		   struct store_by_pieces_d *data)
 {
   unsigned int size = GET_MODE_SIZE (mode);
@@ -3049,7 +3049,7 @@ emit_move_via_integer (enum machine_mode
   y = emit_move_change_mode (imode, mode, y, force);
   if (y == NULL_RTX)
     return NULL_RTX;
-  return emit_insn (GEN_FCN (code) (x, y));
+  return emit_insn (GEN_FCN2 (code) (x, y));
 }
 
 /* A subroutine of emit_move_insn_1.  X is a push_operand in MODE.
@@ -3245,7 +3245,7 @@ emit_move_ccmode (enum machine_mode mode
 	{
 	  x = emit_move_change_mode (CCmode, mode, x, true);
 	  y = emit_move_change_mode (CCmode, mode, y, true);
-	  return emit_insn (GEN_FCN (code) (x, y));
+	  return emit_insn (GEN_FCN2 (code) (x, y));
 	}
     }
 
@@ -3382,7 +3382,7 @@ emit_move_insn_1 (rtx x, rtx y)
 
   code = optab_handler (mov_optab, mode);
   if (code != CODE_FOR_nothing)
-    return emit_insn (GEN_FCN (code) (x, y));
+    return emit_insn (GEN_FCN2 (code) (x, y));
 
   /* Expand complex moves by moving real part and imag part.  */
   if (COMPLEX_MODE_P (mode))
@@ -6277,7 +6277,7 @@ store_constructor (tree exp, rtx target,
 	  }
 
 	if (vector)
-	  emit_insn (GEN_FCN (icode)
+	  emit_insn (GEN_FCN2 (icode)
 		     (target,
 		      gen_rtx_PARALLEL (GET_MODE (target), vector)));
 	break;
@@ -10182,7 +10182,7 @@ expand_expr_real_1 (tree exp, rtx target
 	      reg = gen_reg_rtx (mode);
 
 	      /* Nor can the insn generator.  */
-	      insn = GEN_FCN (icode) (reg, op0);
+	      insn = GEN_FCN2 (icode) (reg, op0);
 	      emit_insn (insn);
 	      return reg;
 	    }
--- gcc-4.7.3/gcc/genoutput.c.~1~	2011-07-21 16:48:03.000000000 +0200
+++ gcc-4.7.3/gcc/genoutput.c	2013-05-25 10:45:12.453139261 +0200
@@ -398,9 +398,25 @@ output_insn_data (void)
 	}
 
       if (d->name && d->name[0] != '*')
-	printf ("    (insn_gen_fn) gen_%s,\n", d->name);
+	{
+	  int i;
+
+	  printf ("#if HAVE_DESIGNATED_UNION_INITIALIZERS\n");
+	  printf ("    { .argc%d = gen_%s },\n", d->n_generator_args, d->name);
+	  printf ("#else\n");
+	  printf ("    { ");
+	  for (i = 0; i < d->n_generator_args; i++)
+	    printf ("0, ");
+	  printf ("gen_%s, ", d->name);
+	  for (i = d->n_generator_args + 1; i <= 11; i++)
+	    printf ("0, ");
+	  printf ("},\n");
+	  printf ("#endif\n");
+	}
       else
-	printf ("    0,\n");
+	{
+	  printf ("    { 0 },\n");
+	}
 
       printf ("    &operand_data[%d],\n", d->operand_number);
       printf ("    %d,\n", d->n_generator_args);
--- gcc-4.7.3/gcc/optabs.c.~1~	2012-12-14 17:26:17.000000000 +0100
+++ gcc-4.7.3/gcc/optabs.c	2013-05-25 10:52:08.093024725 +0200
@@ -761,7 +761,7 @@ expand_vector_broadcast (enum machine_mo
     return NULL;
 
   ret = gen_reg_rtx (vmode);
-  emit_insn (GEN_FCN (icode) (ret, gen_rtx_PARALLEL (vmode, vec)));
+  emit_insn (GEN_FCN2 (icode) (ret, gen_rtx_PARALLEL (vmode, vec)));
 
   return ret;
 }
@@ -4002,7 +4002,7 @@ prepare_cmp_insn (rtx x, rtx y, enum rtx
 	  result_mode = insn_data[cmp_code].operand[0].mode;
 	  result = gen_reg_rtx (result_mode);
 	  size = convert_to_mode (cmp_mode, size, 1);
-	  emit_insn (GEN_FCN (cmp_code) (result, x, y, size, opalign));
+	  emit_insn (GEN_FCN5 (cmp_code) (result, x, y, size, opalign));
 
           *ptest = gen_rtx_fmt_ee (comparison, VOIDmode, result, const0_rtx);
           *pmode = result_mode;
@@ -4176,7 +4176,7 @@ emit_cmp_and_jump_insn_1 (rtx test, enum
 
   gcc_assert (icode != CODE_FOR_nothing);
   gcc_assert (insn_operand_matches (icode, 0, test));
-  emit_jump_insn (GEN_FCN (icode) (test, XEXP (test, 0), XEXP (test, 1), label));
+  emit_jump_insn (GEN_FCN4 (icode) (test, XEXP (test, 0), XEXP (test, 1), label));
 }
 
 /* Generate code to compare X with Y so that the condition codes are
@@ -4605,7 +4605,7 @@ gen_add2_insn (rtx x, rtx y)
   gcc_assert (insn_operand_matches (icode, 1, x));
   gcc_assert (insn_operand_matches (icode, 2, y));
 
-  return GEN_FCN (icode) (x, x, y);
+  return GEN_FCN3 (icode) (x, x, y);
 }
 
 /* Generate and return an insn body to add r1 and c,
@@ -4622,7 +4622,7 @@ gen_add3_insn (rtx r0, rtx r1, rtx c)
       || !insn_operand_matches (icode, 2, c))
     return NULL_RTX;
 
-  return GEN_FCN (icode) (r0, r1, c);
+  return GEN_FCN3 (icode) (r0, r1, c);
 }
 
 int
@@ -4656,7 +4656,7 @@ gen_sub2_insn (rtx x, rtx y)
   gcc_assert (insn_operand_matches (icode, 1, x));
   gcc_assert (insn_operand_matches (icode, 2, y));
 
-  return GEN_FCN (icode) (x, x, y);
+  return GEN_FCN3 (icode) (x, x, y);
 }
 
 /* Generate and return an insn body to subtract r1 and c,
@@ -4673,7 +4673,7 @@ gen_sub3_insn (rtx r0, rtx r1, rtx c)
       || !insn_operand_matches (icode, 2, c))
     return NULL_RTX;
 
-  return GEN_FCN (icode) (r0, r1, c);
+  return GEN_FCN3 (icode) (r0, r1, c);
 }
 
 int
@@ -4737,7 +4737,7 @@ gen_extend_insn (rtx x, rtx y, enum mach
 		 enum machine_mode mfrom, int unsignedp)
 {
   enum insn_code icode = can_extend_p (mto, mfrom, unsignedp);
-  return GEN_FCN (icode) (x, y);
+  return GEN_FCN2 (icode) (x, y);
 }
 
 /* can_fix_p and can_float_p say whether the target machine
@@ -6679,7 +6679,7 @@ gen_cond_trap (enum rtx_code code, rtx o
   if (!trap_rtx)
     insn = NULL_RTX;
   else
-    insn = GEN_FCN (icode) (trap_rtx, XEXP (trap_rtx, 0), XEXP (trap_rtx, 1),
+    insn = GEN_FCN4 (icode) (trap_rtx, XEXP (trap_rtx, 0), XEXP (trap_rtx, 1),
 			    tcode);
 
   /* If that failed, then give up.  */
@@ -8321,28 +8321,28 @@ maybe_gen_insn (enum insn_code icode, un
   switch (nops)
     {
     case 1:
-      return GEN_FCN (icode) (ops[0].value);
+      return GEN_FCN1 (icode) (ops[0].value);
     case 2:
-      return GEN_FCN (icode) (ops[0].value, ops[1].value);
+      return GEN_FCN2 (icode) (ops[0].value, ops[1].value);
     case 3:
-      return GEN_FCN (icode) (ops[0].value, ops[1].value, ops[2].value);
+      return GEN_FCN3 (icode) (ops[0].value, ops[1].value, ops[2].value);
     case 4:
-      return GEN_FCN (icode) (ops[0].value, ops[1].value, ops[2].value,
-			      ops[3].value);
+      return GEN_FCN4 (icode) (ops[0].value, ops[1].value, ops[2].value,
+			       ops[3].value);
     case 5:
-      return GEN_FCN (icode) (ops[0].value, ops[1].value, ops[2].value,
-			      ops[3].value, ops[4].value);
+      return GEN_FCN5 (icode) (ops[0].value, ops[1].value, ops[2].value,
+			       ops[3].value, ops[4].value);
     case 6:
-      return GEN_FCN (icode) (ops[0].value, ops[1].value, ops[2].value,
-			      ops[3].value, ops[4].value, ops[5].value);
+      return GEN_FCN6 (icode) (ops[0].value, ops[1].value, ops[2].value,
+			       ops[3].value, ops[4].value, ops[5].value);
     case 7:
-      return GEN_FCN (icode) (ops[0].value, ops[1].value, ops[2].value,
-			      ops[3].value, ops[4].value, ops[5].value,
-			      ops[6].value);
+      return GEN_FCN7 (icode) (ops[0].value, ops[1].value, ops[2].value,
+			       ops[3].value, ops[4].value, ops[5].value,
+			       ops[6].value);
     case 8:
-      return GEN_FCN (icode) (ops[0].value, ops[1].value, ops[2].value,
-			      ops[3].value, ops[4].value, ops[5].value,
-			      ops[6].value, ops[7].value);
+      return GEN_FCN8 (icode) (ops[0].value, ops[1].value, ops[2].value,
+			       ops[3].value, ops[4].value, ops[5].value,
+			       ops[6].value, ops[7].value);
     }
   gcc_unreachable ();
 }
--- gcc-4.7.3/gcc/optabs.h.~1~	2012-01-17 21:37:46.000000000 +0100
+++ gcc-4.7.3/gcc/optabs.h	2013-05-25 10:45:17.613133104 +0200
@@ -75,7 +75,18 @@ typedef struct convert_optab_d *convert_
 
 /* Given an enum insn_code, access the function to construct
    the body of that kind of insn.  */
-#define GEN_FCN(CODE) (insn_data[CODE].genfun)
+#define GEN_FCN0(CODE)	(insn_data[CODE].genfun.argc0)
+#define GEN_FCN1(CODE)	(insn_data[CODE].genfun.argc1)
+#define GEN_FCN2(CODE)	(insn_data[CODE].genfun.argc2)
+#define GEN_FCN3(CODE)	(insn_data[CODE].genfun.argc3)
+#define GEN_FCN4(CODE)	(insn_data[CODE].genfun.argc4)
+#define GEN_FCN5(CODE)	(insn_data[CODE].genfun.argc5)
+#define GEN_FCN6(CODE)	(insn_data[CODE].genfun.argc6)
+#define GEN_FCN7(CODE)	(insn_data[CODE].genfun.argc7)
+#define GEN_FCN8(CODE)	(insn_data[CODE].genfun.argc8)
+#define GEN_FCN9(CODE)	(insn_data[CODE].genfun.argc9)
+#define GEN_FCN10(CODE)	(insn_data[CODE].genfun.argc10)
+#define GEN_FCN11(CODE)	(insn_data[CODE].genfun.argc11)
 
 /* Enumeration of valid indexes into optab_table.  */
 enum optab_index
--- gcc-4.7.3/gcc/recog.h.~1~	2011-07-21 16:48:03.000000000 +0200
+++ gcc-4.7.3/gcc/recog.h	2013-05-25 10:45:17.613133104 +0200
@@ -257,7 +257,6 @@ extern struct operand_alternative recog_
 
 typedef int (*insn_operand_predicate_fn) (rtx, enum machine_mode);
 typedef const char * (*insn_output_fn) (rtx *, rtx);
-typedef rtx (*insn_gen_fn) (rtx, ...);
 
 struct insn_operand_data
 {
@@ -292,14 +291,41 @@ struct insn_data_d
     const char *const *multi;
     insn_output_fn function;
   } output;
+  union {
+    rtx (*argc0)	(void);
+    rtx (*argc1)	(rtx);
+    rtx (*argc2)	(rtx, rtx);
+    rtx (*argc3)	(rtx, rtx, rtx);
+    rtx (*argc4)	(rtx, rtx, rtx, rtx);
+    rtx (*argc5)	(rtx, rtx, rtx, rtx, rtx);
+    rtx (*argc6)	(rtx, rtx, rtx, rtx, rtx, rtx);
+    rtx (*argc7)	(rtx, rtx, rtx, rtx, rtx, rtx, rtx);
+    rtx (*argc8)	(rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx);
+    rtx (*argc9)	(rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx);
+    rtx (*argc10)	(rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx);
+    rtx (*argc11)	(rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx);
+  } genfun;
 #else
   struct {
     const char *single;
     const char *const *multi;
     insn_output_fn function;
   } output;
+  struct {
+    rtx (*argc0)	(void);
+    rtx (*argc1)	(rtx);
+    rtx (*argc2)	(rtx, rtx);
+    rtx (*argc3)	(rtx, rtx, rtx);
+    rtx (*argc4)	(rtx, rtx, rtx, rtx);
+    rtx (*argc5)	(rtx, rtx, rtx, rtx, rtx);
+    rtx (*argc6)	(rtx, rtx, rtx, rtx, rtx, rtx);
+    rtx (*argc7)	(rtx, rtx, rtx, rtx, rtx, rtx, rtx);
+    rtx (*argc8)	(rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx);
+    rtx (*argc9)	(rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx);
+    rtx (*argc10)	(rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx);
+    rtx (*argc11)	(rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx, rtx);
+  } genfun;
 #endif
-  const insn_gen_fn genfun;
   const struct insn_operand_data *const operand;
 
   const char n_generator_args;
--- gcc-4.7.3/gcc/reload1.c.~1~	2012-05-15 04:14:05.000000000 +0200
+++ gcc-4.7.3/gcc/reload1.c	2013-05-25 10:45:17.623133091 +0200
@@ -7508,7 +7508,7 @@ emit_input_reload_insns (struct insn_cha
 	      /* We'd have to add extra code to handle this case.  */
 	      gcc_assert (!third_reload_reg);
 
-	      emit_insn (GEN_FCN (icode) (reloadreg, real_oldequiv,
+	      emit_insn (GEN_FCN3 (icode) (reloadreg, real_oldequiv,
 					  second_reload_reg));
 	      special = 1;
 	    }
@@ -7518,7 +7518,7 @@ emit_input_reload_insns (struct insn_cha
 		 intermediate register (a tertiary reload).  */
 	      if (tertiary_icode != CODE_FOR_nothing)
 		{
-		  emit_insn ((GEN_FCN (tertiary_icode)
+		  emit_insn ((GEN_FCN3 (tertiary_icode)
 			      (second_reload_reg, real_oldequiv,
 			       third_reload_reg)));
 		}
@@ -7627,7 +7627,7 @@ emit_output_reload_insns (struct insn_ch
 	      /* We'd have to add extra code to handle this case.  */
 	      gcc_assert (tertiary_reload < 0);
 
-	      emit_insn ((GEN_FCN (rl->secondary_out_icode)
+	      emit_insn ((GEN_FCN3 (rl->secondary_out_icode)
 			  (real_old, second_reloadreg, reloadreg)));
 	      special = 1;
 	    }
@@ -7661,7 +7661,7 @@ emit_output_reload_insns (struct insn_ch
 
 		  gen_reload (reloadreg, second_reloadreg,
 			      rl->opnum, rl->when_needed);
-		  emit_insn ((GEN_FCN (tertiary_icode)
+		  emit_insn ((GEN_FCN3 (tertiary_icode)
 			      (real_old, reloadreg, third_reloadreg)));
 		  special = 1;
 		}
