
                                 George K. Rosenberg
                                  90 Woodland Road
                           Pittsburgh, Pennsylvania 15232
                                  January 24, 1981



          Login Newsletter
          Computation Center
          The University of Texas
          Austin, TX  78712
          Attn: Wally Wedel

          Dear Mr. Wedel,


               I have discovered an anomaly in the code generation of  some
          pdp-11  C  compilers.   You may want to report this in ";login:",
          since there may be people who are unaware of it.


               In certain contexts the wrong  type  of  conditional  branch
          instruction  is  generated.  Instructions such as "jge" may occur
          rather than instructions such as  "jpl".   I  have  observed  the
          problem  with both of the compilers distributed with UNIX version
          7, Dennis M. Ritchie's compiler and  Stephen  C.  Johnson's  com-
          piler.  The expression,
                            "(j-i < 0) == (j-i < zero)",
          evaluates to zero (i.e. false) in  the  accompanying  program  as
          compiled with these compilers.


               I have what seems to be a working fixed version of Dennis M.
          Ritchie's compiler.  I will probably make these changes available
          in a future Usenix association software distribution.


               Although this anomaly seems serious, remember  that  many  C
          programs have seemingly worked properly over a number of years.


                                     Sincerely,






          copies:
          Dennis M. Ritchie
          Stephen C. Johnson














