PR tree-optimization/33562
[official-gcc.git] / gcc / testsuite / gcc.dg / sms-8.c
blob78a2b50116f87a50e51b1c8b00c38f38a229d72f
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. */
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*-*-* } } */
9 extern void abort (void);
11 __attribute__ ((noinline))
12 unsigned long long
13 foo (long long ixi, unsigned ctr)
15 unsigned long long irslt = 1;
16 long long ix = ixi;
18 for (; ctr; ctr--)
20 irslt *= ix;
21 ix *= ix;
24 if (irslt != 14348907)
25 abort ();
26 return irslt;
30 int
31 main ()
33 unsigned long long res;
35 res = foo (3, 4);
36 return 0;
39 /* { dg-final { scan-rtl-dump-times "SMS succeeded" 0 "sms" { target powerpc*-*-* } } } */