2014-07-29 Ed Smith-Rowland <3dw4rd@verizon.net>
[official-gcc.git] / gcc / testsuite / gcc.dg / loop-3.c
blob6bdb5ef5697793ac979652bd6845867d08731b9c
1 /* PR optimization/13985 */
2 /* Copied from gcc.c-torture/compile/930621-1.c */
4 /* { dg-do compile } */
5 /* { dg-options "-O3" } */
6 /* { dg-options "-O3 -mtune=i386" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
8 #if defined(STACK_SIZE) && (STACK_SIZE < 65536)
9 # define BYTEMEM_SIZE 10000L
10 #endif
12 #ifndef BYTEMEM_SIZE
13 # define BYTEMEM_SIZE 45000L
14 #endif
16 int bytestart[5000 + 1];
17 unsigned char modtext[400 + 1];
18 unsigned char bytemem[2][BYTEMEM_SIZE + 1];
20 long
21 modlookup (int l)
23 signed char c;
24 long j;
25 long k;
26 signed char w;
27 long p;
28 while (p != 0)
30 while ((k < bytestart[p + 2]) && (j <= l) && (modtext[j] == bytemem[w][k]))
32 k = k + 1;
33 j = j + 1;
35 if (k == bytestart[p + 2])
36 if (j > l)
37 c = 1;
38 else c = 4;
39 else if (j > l)
40 c = 3;
41 else if (modtext[j] < bytemem[w][k])
42 c = 0;
43 else c = 2;