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