Gnugrep on Sun 4 - compiler bug & work-round
Ian Phillipps
igp at camcon.co.uk
Tue Apr 25 02:28:41 AEST 1989
The recently-posted GNU grep fails Spencer test 36, when compiled with "-O"
on sparc/Sunos4.0.1. "-O1" was ok.
As the compiler was having trouble with an area with lots of FETCH macro
calls, I placed the following patch, which gets round the bug.
*** dfa.c.orig Tue Feb 21 15:03:28 1989
--- dfa.c Mon Apr 24 17:00:47 1989
***************
*** 299,304 ****
--- 299,305 ----
static _token
lex()
{
+ static char E_BAD_PAREN[] = "Unbalanced [";
_token c, c2;
int invert;
_charset cset;
***************
*** 460,469 ****
case '[':
zeroset(cset);
! FETCH(c, "Unbalanced [");
if (c == '^')
{
! FETCH(c, "Unbalanced [");
invert = 1;
}
else
--- 461,470 ----
case '[':
zeroset(cset);
! FETCH(c, E_BAD_PAREN);
if (c == '^')
{
! FETCH(c, E_BAD_PAREN);
invert = 1;
}
else
***************
*** 470,482 ****
invert = 0;
do
{
! FETCH(c2, "Unbalanced [");
if (c2 == '-')
{
! FETCH(c2, "Unbalanced [");
while (c <= c2)
setbit(c++, cset);
! FETCH(c, "Unbalanced [");
}
else
{
--- 471,483 ----
invert = 0;
do
{
! FETCH(c2, E_BAD_PAREN);
if (c2 == '-')
{
! FETCH(c2, E_BAD_PAREN);
while (c <= c2)
setbit(c++, cset);
! FETCH(c, E_BAD_PAREN);
}
else
{
****************
[End of patch]
--
UUCP: igp at camcon.co.uk | Cambridge Consultants Ltd | Ian Phillipps
or: igp at camcon.uucp | Science Park, Milton Road |-----------------
Phone: +44 223 420024 | Cambridge CB4 4DW, England |
More information about the Comp.sources.bugs
mailing list