1 /* This test is a reduced test case for a bug that caused
2 bootstrapping with -fmodulo-sched. Related to a broken anti-dep
3 that was not fixed by reg-moves. */
4
5 /* { dg-do run } */
6 /* { dg-options "-O2 -fmodulo-sched -fmodulo-sched-allow-regmoves -fdump-rtl-sms --param sms-min-sc=1" } */
7 /* { dg-options "-O2 -fmodulo-sched -fmodulo-sched-allow-regmoves -fdump-rtl-sms" { target powerpc*-*-* } } */
8
9 extern void abort (void);
10
11 __attribute__ ((noinline))
12 unsigned long long
foo(long long ixi,unsigned ctr)13 foo (long long ixi, unsigned ctr)
14 {
15 unsigned long long irslt = 1;
16 long long ix = ixi;
17
18 for (; ctr; ctr--)
19 {
20 irslt *= ix;
21 ix *= ix;
22 }
23
24 if (irslt != 14348907)
25 abort ();
26 return irslt;
27 }
28
29
30 int
main()31 main ()
32 {
33 unsigned long long res;
34
35 res = foo (3, 4);
36 return 0;
37 }
38
39 /* { dg-final { scan-rtl-dump-times "SMS succeeded" 0 "sms" { target powerpc*-*-* } } } */
40 /* { dg-final { cleanup-rtl-dump "sms" } } */
41
42
43