annotate gcc/testsuite/gcc.dg/stack-check-10.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* { dg-do compile } */
kono
parents:
diff changeset
2 /* { dg-options "-O2 -fstack-clash-protection -fdump-rtl-pro_and_epilogue -fno-optimize-sibling-calls --param stack-clash-protection-probe-interval=12 --param stack-clash-protection-guard-size=12" } */
kono
parents:
diff changeset
3 /* { dg-require-effective-target supports_stack_clash_protection } */
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 int f (int *);
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 int
kono
parents:
diff changeset
8 g (int a)
kono
parents:
diff changeset
9 {
kono
parents:
diff changeset
10 return f (&a);
kono
parents:
diff changeset
11 }
kono
parents:
diff changeset
12
kono
parents:
diff changeset
13 int f1 (void);
kono
parents:
diff changeset
14 int f2 (int);
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 int
kono
parents:
diff changeset
17 f3 (void)
kono
parents:
diff changeset
18 {
kono
parents:
diff changeset
19 return f2 (f1 ());
kono
parents:
diff changeset
20 }
kono
parents:
diff changeset
21
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23 /* If we have caller implicit probes, then we should not need probes in either callee.
kono
parents:
diff changeset
24 Else callees may need probes, particularly if non-leaf functions require a
kono
parents:
diff changeset
25 frame/frame pointer. */
kono
parents:
diff changeset
26 /* { dg-final { scan-rtl-dump-times "Stack clash no probe" 2 "pro_and_epilogue" { target caller_implicit_probes } } } */
kono
parents:
diff changeset
27 /* { dg-final { scan-rtl-dump-times "Stack clash inline probe" 1 "pro_and_epilogue" { target { ! caller_implicit_probes } } } } */
kono
parents:
diff changeset
28 /* { dg-final { scan-rtl-dump-times "Stack clash no probe" 1 "pro_and_epilogue" { target { ! caller_implicit_probes } } } } */
kono
parents:
diff changeset
29
kono
parents:
diff changeset
30 /* Neither of these functions are a nonreturn function. */
kono
parents:
diff changeset
31 /* { dg-final { scan-rtl-dump-times "Stack clash not noreturn" 2 "pro_and_epilogue" } } */
kono
parents:
diff changeset
32
kono
parents:
diff changeset
33 /* If the callee realigns the stack or has a mandatory frame, then both functions
kono
parents:
diff changeset
34 have a residual allocation. Else just g() has a residual allocation. */
kono
parents:
diff changeset
35 /* { dg-final { scan-rtl-dump-times "Stack clash residual allocation in prologue" 2 "pro_and_epilogue" } } */
kono
parents:
diff changeset
36
kono
parents:
diff changeset
37
kono
parents:
diff changeset
38 /* If the target has frame pointers for non-leafs, then both functions will
kono
parents:
diff changeset
39 need a frame pointer. Otherwise neither should. */
kono
parents:
diff changeset
40 /* { dg-final { scan-rtl-dump-times "Stack clash no frame pointer needed" 2 "pro_and_epilogue" { target { ! frame_pointer_for_non_leaf } } } } */
kono
parents:
diff changeset
41 /* { dg-final { scan-rtl-dump-times "Stack clash frame pointer needed" 2 "pro_and_epilogue" { target { frame_pointer_for_non_leaf } } } } */
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
42 /* { dg-final { scan-rtl-dump-times "Stack clash no probe small stack adjustment in prologue" 2 "pro_and_epilogue" { target { aarch64*-*-* } } } } */