1 /* PR 94131 - ICE on printf with a VLA string and -fno-tree-ccp 2 -fno-tree-forwprop 3 { dg-do compile } 4 { dg-options "-O1 -fno-tree-ccp -fno-tree-forwprop" } 5 { dg-require-effective-target alloca } */ 6 rv1(int n)7void rv1 (int n) 8 { 9 char a[n]; 10 __INTPTR_TYPE__ i = (__INTPTR_TYPE__ )&a[0]; 11 i &= 3; 12 13 __builtin_memset (a, '\0', sizeof a); 14 __builtin_printf ("%s", i ? &a[0] : ""); 15 } 16 17 18 void sink (void*); 19 rv2(int n)20void rv2 (int n) 21 { 22 char a[n]; 23 __INTPTR_TYPE__ i = (__INTPTR_TYPE__)&a[0]; 24 i &= 3; 25 26 __builtin_memset (a, '\0', sizeof a); 27 __builtin_printf ("%s", i ? &a[0] : ""); 28 29 sink (a); 30 } 31