usbmodeswitch: Updated to v.1.2.6 from shibby's branch.
[tomato.git] / release / src / router / openssl / bugs / dggccbug.c
blob30e07a60ea4a0d526fe96648227463db1d94492c
1 /* NOCW */
2 /* dggccbug.c */
3 /* bug found by Eric Young (eay@cryptsoft.com) - May 1995 */
5 #include <stdio.h>
7 /* There is a bug in
8 * gcc version 2.5.8 (88open OCS/BCS, DG-2.5.8.3, Oct 14 1994)
9 * as shipped with DGUX 5.4R3.10 that can be bypassed by defining
10 * DG_GCC_BUG in my code.
11 * The bug manifests itself by the vaule of a pointer that is
12 * used only by reference, not having it's value change when it is used
13 * to check for exiting the loop. Probably caused by there being 2
14 * copies of the valiable, one in a register and one being an address
15 * that is passed. */
17 /* compare the out put from
18 * gcc dggccbug.c; ./a.out
19 * and
20 * gcc -O dggccbug.c; ./a.out
21 * compile with -DFIXBUG to remove the bug when optimising.
24 void inc(a)
25 int *a;
27 (*a)++;
30 main()
32 int p=0;
33 #ifdef FIXBUG
34 int dummy;
35 #endif
37 while (p<3)
39 fprintf(stderr,"%08X\n",p);
40 inc(&p);
41 #ifdef FIXBUG
42 dummy+=p;
43 #endif