This test changes from TREE_INT_CST_LOW to TREE_INT_CST_ELT. I was going to change it back as part of the previous patch, but using wi:: seemed more robust.
Only compile-tested so far because of problems with gcc110. OK for wide-int? Richard Index: gcc/config/rs6000/rs6000.c =================================================================== --- gcc/config/rs6000/rs6000.c 2013-11-20 11:26:05.996351099 +0000 +++ gcc/config/rs6000/rs6000.c 2013-11-20 11:43:37.896818266 +0000 @@ -12131,16 +12131,14 @@ rs6000_expand_ternop_builtin (enum insn_ /* Check whether the 2nd and 3rd arguments are integer constants and in range and prepare arguments. */ STRIP_NOPS (arg1); - if (TREE_CODE (arg1) != INTEGER_CST - || !IN_RANGE (TREE_INT_CST_ELT (arg1, 0), 0, 1)) + if (TREE_CODE (arg1) != INTEGER_CST || wi::geu_p (arg1, 2)) { error ("argument 2 must be 0 or 1"); return const0_rtx; } STRIP_NOPS (arg2); - if (TREE_CODE (arg2) != INTEGER_CST - || !IN_RANGE (TREE_INT_CST_ELT (arg2, 0), 0, 15)) + if (TREE_CODE (arg2) != INTEGER_CST || wi::geu_p (arg1, 16)) { error ("argument 3 must be in the range 0..15"); return const0_rtx;