1 /* Simple check that sibling calls are performed from a
2 void non-leaf-function taking one int argument calling itself.
4 Copyright (C) 2002 Free Software Foundation Inc.
5 Contributed by Hans-Peter Nilsson <hp@bitrange.com> */
8 /* { dg-options "-O2 -foptimize-sibling-calls" } */
10 /* See note in recurser_void() as to why we disable threading. */
11 /* { dg-additional-options "-fdisable-tree-thread1" } */
13 /* The option -foptimize-sibling-calls is the default, but serves as
14 marker. Self-recursion tail calls are optimized for all targets,
15 regardless of presence of sibcall patterns. */
17 extern void abort (void);
18 extern void exit (int);
20 extern void recurser_void (int);
21 extern void track (int);
32 /* In some architectures like ppc64*, jump threading may thread
33 paths such that there are two calls into track(), one for
34 track(0) and one for track(7). The track(7) call can be
35 transformed into a jump instead of a call, which means that
36 different calls into track() may end up with a different
37 &stackpos. This is the reason we disable jump threading for this
45 recurser_void (n
+ 1);
50 void __attribute__ ((noipa
))
56 trackpoint
= stackpos
;
57 else if (n
!= 7 || trackpoint
!= stackpos
)