1 /* PR tree-optimization/83640 - ice in generic_overlap, at
2 gimple-ssa-warn-restrict.c:814
3 Test to verify that a pointer offset range whose upper bound is less
4 than its lower bound (when interpreted as a signed integer) is handled
7 { dg-options "-O2 -Wrestrict" } */
11 extern char* strcpy (char*, const char*);
12 extern char* stpcpy (char*, const char*);
16 void warn_2_smax_p2 (void)
22 ptrdiff_t i
= UR (2, DIFF_MAX
+ (size_t)2);
24 strcpy (d
, d
+ i
); /* { dg-warning "accessing between 1 and 4 bytes at offsets 0 and \\\[2, 7] may overlap up to 2 bytes at offset \\\[2, 3]" } */
29 void nowarn_3_smax_p2 (void)
35 ptrdiff_t i
= UR (3, DIFF_MAX
+ (size_t)2);
42 void warn_2u_smax_p2 (void)
48 size_t i
= UR (2, DIFF_MAX
+ (size_t)2);
50 strcpy (d
, d
+ i
); /* { dg-warning "accessing between 1 and 4 bytes at offsets 0 and \\\[2, 7] may overlap up to 2 bytes at offset \\\[2, 3]" } */
55 void nowarn_3u_smax_p2 (void)
61 size_t i
= UR (3, DIFF_MAX
+ (size_t)2);