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 rv1(int n)6void rv1 (int n) 7 { 8 char a[n]; 9 __INTPTR_TYPE__ i = (__INTPTR_TYPE__ )&a[0]; 10 i &= 3; 11 12 __builtin_memset (a, '\0', sizeof a); 13 __builtin_printf ("%s", i ? &a[0] : ""); 14 } 15 16 17 void sink (void*); 18 rv2(int n)19void rv2 (int n) 20 { 21 char a[n]; 22 __INTPTR_TYPE__ i = (__INTPTR_TYPE__)&a[0]; 23 i &= 3; 24 25 __builtin_memset (a, '\0', sizeof a); 26 __builtin_printf ("%s", i ? &a[0] : ""); 27 28 sink (a); 29 } 30