Testcase: typedef __attribute__((__vector_size__(16) )) unsigned char vec_uchar16; template<typename Tx, typename Ty, typename Tz, typename Tw> void permute(Tx x, Ty y, Tz z, Tw w) { const vec_uchar16 pattern = (vec_uchar16){4*x, 4*x+1, 4*x+2, 4*x+3, 4*y, 4*y+1, 4*y+2, 4*y+3, 4*z, 4*z+1, 4*z+2, 4*z+3, 4*w, 4*w+1, 4*w+2, 4*w+3}; } int main() { permute(1,2,3,4); return 0; }
This starts passing for me between 2007-03-10 and 2007-03-20. Andrew, if it fails for you with a later mainline than that, perhaps it's an intermittent failure rather than a regression.
I was testing at the time "4.3.0 20070306" and I tested with yesterday's trunk and it passes. It also works on the 4.2 branch as of "4.2.0 20070415".
A regression hunt on powerpc-linux for mainline shows that it was fixed by this patch: http://gcc.gnu.org/viewcvs?view=rev&rev=122829 r122829 | mmitchel | 2007-03-12 00:26:39 +0000 (Mon, 12 Mar 2007) That patch was added to the 4.2 branch at the same time, and the test now passes on that branch. The failure still occurs on the 4.1 branch as of 2007-04-19.
Yeah, this is fixed by the PR31038 patch and that patch fixes this even on gcc-4_1-branch. But the original PR31038 testcase still ICEs on 4.1 even with PR31038 patch.
Confirmed.
Index: pt.c =================================================================== --- pt.c (revision 2500) +++ pt.c (working copy) @@ -12464,6 +12464,20 @@ value_dependent_expression_p (tree expre return value_dependent_expression_p (args); } + + case CONSTRUCTOR: + { + unsigned HOST_WIDE_INT idx; + tree value; + VEC(constructor_elt,gc) *v = CONSTRUCTOR_ELTS (expression); + + FOR_EACH_CONSTRUCTOR_VALUE (v, idx, value) + { + if (value_dependent_expression_p (value)) + return true; + } + return false; + } default: /* A constant expression is value-dependent if any subexpression is
Closing 4.1 branch.