1 /* PR tree-optimization/101419 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2" } */
5 typedef __SIZE_TYPE__
size_t;
6 void baz (int, int) __attribute__((__warning__("detected overflow")));
16 if (__builtin_object_size (&u
->c
, 1) < sizeof (u
->c
))
17 baz (__builtin_object_size (&u
->c
, 1), sizeof (u
->c
)); /* { dg-bogus "detected overflow" } */
18 __builtin_memset (&u
->c
, 0, sizeof (u
->c
));
20 if (__builtin_object_size (&u
->i
, 1) < sizeof (u
->i
))
21 baz (__builtin_object_size (&u
->i
, 1), sizeof (u
->i
)); /* { dg-bogus "detected overflow" } */
22 __builtin_memset (&u
->i
, 0, sizeof (u
->i
));
29 for (i
= 0; i
< 1; i
++)
32 for (j
= 0; j
< 2; j
++)
38 qux (void *p
, size_t q
)
40 if (__builtin_object_size (p
, 1) < q
)
41 baz (__builtin_object_size (p
, 1), q
); /* { dg-bogus "detected overflow" } */
42 __builtin_memset (p
, 0, q
);
48 qux (&u
->c
, sizeof (u
->c
));
49 qux (&u
->i
, sizeof (u
->i
));
56 for (i
= 0; i
< 1; i
++)
59 for (j
= 0; j
< 2; j
++)