Debian Codegraph @

gcc/testsuite/gcc.dg/tree-ssa/pr79943.c

raw
1 /* { dg-do run } */
2 /* { dg-options "-O2 -fsplit-loops -fdump-tree-lsplit-details" } */
3 /* { dg-require-effective-target int32plus } */
4
5 #ifdef __cplusplus
6 extern "C" void abort (void);
7 #else
8 extern void abort (void);
9 #endif
10
11 typedef struct {
12 int n;
13 } region_t;
14
15 void set (region_t *region) __attribute__((noinline));
16 void doit (region_t *beg, region_t *end, region_t *limit)
17 __attribute__((noinline));
18
19 region_t regions[10];
20
21 void
22 set (region_t *region) {
23 region->n = 1;
24 }
25
26 void
27 doit (region_t *beg, region_t *end, region_t *limit) {
28 for (region_t *cur = beg; cur < end; cur++) {
29 if (cur < limit) {
30 set(cur);
31 }
32 }
33 }
34
35 int
36 main (void) {
37 doit(&regions[0], &regions[2], &regions[10]);
38 if (regions[1].n != 1)
39 abort();
40 }