[comp.sys.next] % interp buffer overflow when compiling rn PL 40 under 1.0 a gcc bug

eps@toaster.SFSU.EDU (Eric P. Scott) (12/15/89)

When this machine was upgraded from 0.9 to 1.0 we recompiled all
the local software.  rn patchlevel 40 started generating
"% interp buffer overflow!" aborts when attempting to follow up
to articles.  The problem has been traced to the gcc optimizer:

*** intrp.c	Fri Nov 21 14:26:45 1986

  834		    i = metabit;		/* maybe get into register */
  835		    if (s == dest) {
  836			while (*dest) {
  837			    if (--destsize <= 0)
  838				abort_interp();
  839			    *dest++ |= i;
                                 ^^ this increment lost in optimization
  840			}
  841		    }
  842		    else {
  843			while (*s) {
  844			    if (--destsize <= 0)
  845				abort_interp();
  846			    *dest++ = *s++ | i;
  847			}
  848		    }

Compiling intrp.c without -O "works" ok.

					-=EPS=-