blob: 413ed67d2391c8f481b8b6253b6a8f4e4fed1740 (
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
31
32
33
34
|
/* { dg-do compile } */
/* { dg-options "-fdump-tree-original" } */
char c1 __attribute__ ((aligned (1)));
char c2 __attribute__ ((aligned (2)));
char c4 __attribute__ ((aligned (4)));
char c8 __attribute__ ((aligned (8)));
unsigned f1(void)
{
return 3 & (__SIZE_TYPE__)&c1;
}
unsigned f2(void)
{
return 3 & (__SIZE_TYPE__)&c2;
}
unsigned f3(void)
{
return 3 & (__SIZE_TYPE__)&c4;
}
unsigned f4(void)
{
return 3 & (__SIZE_TYPE__)&c8;
}
/* { dg-final { scan-tree-dump-times "\&c1 \& 3" 1 "original" } } */
/* { dg-final { scan-tree-dump-times "\&c2 \& 3" 1 "original" } } */
/* { dg-final { scan-tree-dump-times "\&c4 \& 3" 0 "original" } } */
/* { dg-final { scan-tree-dump-times "\&c8 \& 3" 0 "original" } } */
/* { dg-final { scan-tree-dump-times "return 0" 2 "original" } } */
/* { dg-final { cleanup-tree-dump "original" } } */
|