Import OpenSSL-0.9.8i.
[dragonfly.git] / crypto / openssl-0.9.7d / bugs / ultrixcc.c
blob7ba75b140f1f731f4e87618920cf040f70db643b
1 #include <stdio.h>
3 /* This is a cc optimiser bug for ultrix 4.3, mips CPU.
4 * What happens is that the compiler, due to the (a)&7,
5 * does
6 * i=a&7;
7 * i--;
8 * i*=4;
9 * Then uses i as the offset into a jump table.
10 * The problem is that a value of 0 generates an offset of
11 * 0xfffffffc.
14 main()
16 f(5);
17 f(0);
20 int f(a)
21 int a;
23 switch(a&7)
25 case 7:
26 printf("7\n");
27 case 6:
28 printf("6\n");
29 case 5:
30 printf("5\n");
31 case 4:
32 printf("4\n");
33 case 3:
34 printf("3\n");
35 case 2:
36 printf("2\n");
37 case 1:
38 printf("1\n");
39 #ifdef FIX_BUG
40 case 0:
42 #endif