1 /* PR optimization/13985 */ 2 /* Copied from gcc.c-torture/compile/930621-1.c */ 3 4 /* { dg-do compile } */ 5 /* { dg-options "-O3" } */ 6 /* { dg-options "-O3 -mtune=i386" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */ 7 /* { dg-add-options stack_size } */ 8 9 #if defined(STACK_SIZE) && (STACK_SIZE < 65536) 10 # define BYTEMEM_SIZE 10000L 11 #endif 12 13 #ifndef BYTEMEM_SIZE 14 # define BYTEMEM_SIZE 45000L 15 #endif 16 17 int bytestart[5000 + 1]; 18 unsigned char modtext[400 + 1]; 19 unsigned char bytemem[2][BYTEMEM_SIZE + 1]; 20 21 long modlookup(int l)22modlookup (int l) 23 { 24 signed char c; 25 long j; 26 long k; 27 signed char w; 28 long p; 29 while (p != 0) 30 { 31 while ((k < bytestart[p + 2]) && (j <= l) && (modtext[j] == bytemem[w][k])) 32 { 33 k = k + 1; 34 j = j + 1; 35 } 36 if (k == bytestart[p + 2]) 37 if (j > l) 38 c = 1; 39 else c = 4; 40 else if (j > l) 41 c = 3; 42 else if (modtext[j] < bytemem[w][k]) 43 c = 0; 44 else c = 2; 45 } 46 } 47