1 /* PR tree-optimization/79327 - wrong code at -O2 and -fprintf-return-value
3 { dg-options "-O2 -Wall" } */
5 volatile int a
, b
= -1;
8 #define FMT "%+03d%02d"
9 const char *volatile fmt
= FMT
;
15 if (c
>= -35791395 && c
< 35791394 && d
>= -1 && d
< __INT_MAX__
)
17 /* In the following the range of return values can be computed
19 int n1
= __builtin_sprintf (buf
, FMT
, c
+ 1, d
+ 1);
23 /* Here GCC can't see the format string so the return value
24 must be computed by a libc call. */
25 int n2
= __builtin_sprintf (buf
, fmt
, c
+ 1, d
+ 1);