annotate gcc/testsuite/gcc.c-torture/compile/pr25311.c @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
1 /* { dg-skip-if "exceeds eBPF stack limit" { bpf-*-* } } */
111
kono
parents:
diff changeset
2
kono
parents:
diff changeset
3 struct w
kono
parents:
diff changeset
4 {
kono
parents:
diff changeset
5 int top;
kono
parents:
diff changeset
6 int left;
kono
parents:
diff changeset
7 int height;
kono
parents:
diff changeset
8 int width;
kono
parents:
diff changeset
9 struct w *next;
kono
parents:
diff changeset
10 struct w *parent;
kono
parents:
diff changeset
11 struct w *child;
kono
parents:
diff changeset
12 };
kono
parents:
diff changeset
13
kono
parents:
diff changeset
14 extern struct w *Qnil;
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 void
kono
parents:
diff changeset
17 set_size (struct w *w, int new_size, int nodelete, int set_height)
kono
parents:
diff changeset
18 {
kono
parents:
diff changeset
19 int old_size = set_height? w->height : w->width;
kono
parents:
diff changeset
20
kono
parents:
diff changeset
21 if (nodelete || w->parent == Qnil)
kono
parents:
diff changeset
22 {
kono
parents:
diff changeset
23 int last_pos, last_old_pos, pos, old_pos, first;
kono
parents:
diff changeset
24 int div_val = old_size << 1;
kono
parents:
diff changeset
25 struct w *c;
kono
parents:
diff changeset
26
kono
parents:
diff changeset
27 last_pos = first = set_height? w->top : w->left;
kono
parents:
diff changeset
28 last_old_pos = 0;
kono
parents:
diff changeset
29
kono
parents:
diff changeset
30 for (c = w->child; c != Qnil; c = c->next)
kono
parents:
diff changeset
31 {
kono
parents:
diff changeset
32 if (set_height)
kono
parents:
diff changeset
33 old_pos = last_old_pos + c->height;
kono
parents:
diff changeset
34 else
kono
parents:
diff changeset
35 old_pos = last_old_pos + c->width;
kono
parents:
diff changeset
36
kono
parents:
diff changeset
37 pos = (((old_pos * new_size) << 1) + old_size) / div_val;
kono
parents:
diff changeset
38 set_size (c, pos + first - last_pos, 1, set_height);
kono
parents:
diff changeset
39 last_pos = pos + first;
kono
parents:
diff changeset
40 last_old_pos = old_pos;
kono
parents:
diff changeset
41 }
kono
parents:
diff changeset
42
kono
parents:
diff changeset
43 if (!nodelete)
kono
parents:
diff changeset
44 for (c = w->child; c != Qnil; c = c->next)
kono
parents:
diff changeset
45 use (c);
kono
parents:
diff changeset
46 }
kono
parents:
diff changeset
47 }
kono
parents:
diff changeset
48