1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-forwprop1" } */
4 typedef __SIZE_TYPE__
size_t;
5 typedef __PTRDIFF_TYPE__
ptrdiff_t;
7 ptrdiff_t foo1 (char *a
, size_t n
)
10 char *b2
= a
+ 8 * (n
- 1);
15 int use_ptr (char *a
, char *b
);
17 ptrdiff_t foo2 (char *a
, size_t n
)
19 char *b1
= a
+ 8 * (n
- 1);
29 unsigned goo (unsigned m_param
, unsigned n_param
)
31 unsigned b1
= m_param
* (n_param
+ 2);
32 unsigned b2
= m_param
* (n_param
+ 1);
33 int r
= (int)(b1
) - (int)(b2
);
40 /* { dg-final { scan-tree-dump-times "return 8;" 1 "forwprop1" } } */
41 /* { dg-final { scan-tree-dump-times "return -8;" 1 "forwprop1" } } */
42 /* { dg-final { scan-tree-dump-times "return m_param" 1 "forwprop1" } } */