The following code, when loaded and reset, crashes on the Sun workstation 
using SunOS Release 4.1.3 when the CLIPS 6.0 source file rulebld.c is 
compiled using the cc compiler with level 2 optimizations enabled (-O2).

   (deffunction is-flora
       (?code)
       FALSE)

   (deffacts f1
     (find-general-rule)
     (parsed-org nil))

   (defrule r1
     (find-general-rule)
     (parsed-org ?code)
     (test (is-flora ?code))
     =>)

If you replace the line

      newJoin->depth = lhsEntryStruct->depth + 1;

with

      printf("\nlhsEntryStruct->depth: %d\n",lhsEntryStruct->depth + 1);
      newJoin->depth = lhsEntryStruct->depth + 1;
      printf("newJoin->depth: %d\n",newJoin->depth);

in rulebld.c, you'll see different numbers printed when the CLIPS code
above is loaded depending upon whether or not the level 2 optimizations are 
performed. This should be just a simple assignment, but with the level 2 
optimizations the value of newJoin->depth doesn't get set to 
lhsEntryStruct->depth + 1.

The Sun architecture supports separate code and data segments such that 
attempting to overwrite the code segment causes an immediate access
violation. This would rule out the possible but unlikely situation that the 
code for the assignment was being overwritten with code that prevented the 
assignment from taking place, but didn't cause a crash. 

The simple fix for this problem is to compile the file rulebld.c without
level 2 optimizations.
