middle-end: also optimized `popcount(a) <= 1` [PR90693]
[official-gcc.git] / gcc / testsuite / gcc.dg / 20030721-1.c
blob52be42fc59dfd66885257aa8ab9922ad4a5b9f1a
1 /* PR optimization/11536 */
2 /* { dg-do run } */
3 /* { dg-options "-O2" } */
4 /* Origin: samal@kam.mff.cuni.cz <samal@kam.mff.cuni.cz> */
5 /* Testcase by Andrew Pinski <pinskia@physics.uc.edu> */
7 /* Verify that the loop optimizer doesn't use moving targets
8 to calculate the number of iterations of a loop. */
10 extern void abort(void);
12 void foo(int) __attribute__((__noinline__));
14 void foo(int i)
16 abort();
19 int main()
21 int i;
22 int first= 0;
23 int last= 0;
25 while (last<3) {
26 last = first;
28 while (first<=last) {
29 first++;
31 for (i=0;i<3;i++)
32 last++;
34 if (last>10)
35 return 0;
38 foo(first);
41 return 0;