head 1.1; branch 1.1.1; access; symbols perseant-exfatfs-base-20250801:1.1.1.2 perseant-exfatfs-base-20240630:1.1.1.2 cjep_sun2x:1.1.1.2.0.44 cjep_sun2x-base:1.1.1.2 cjep_staticlib_x-base1:1.1.1.2 cjep_staticlib_x:1.1.1.2.0.42 cjep_staticlib_x-base:1.1.1.2 phil-wifi-20200421:1.1.1.2 phil-wifi-20200411:1.1.1.2 phil-wifi-20200406:1.1.1.2 pgoyette-compat-merge-20190127:1.1.1.2 pgoyette-compat-20190127:1.1.1.2 pgoyette-compat-20190118:1.1.1.2 pgoyette-compat-1226:1.1.1.2 pgoyette-compat-1126:1.1.1.2 pgoyette-compat-1020:1.1.1.2 pgoyette-compat-0930:1.1.1.2 pgoyette-compat-0906:1.1.1.2 pgoyette-compat-0728:1.1.1.2 pgoyette-compat-0625:1.1.1.2 pgoyette-compat-0521:1.1.1.2 pgoyette-compat-0502:1.1.1.2 pgoyette-compat-0422:1.1.1.2 pgoyette-compat-0415:1.1.1.2 pgoyette-compat-0407:1.1.1.2 pgoyette-compat-0330:1.1.1.2 pgoyette-compat-0322:1.1.1.2 pgoyette-compat-0315:1.1.1.2 pgoyette-compat:1.1.1.2.0.40 pgoyette-compat-base:1.1.1.2 perseant-stdc-iso10646:1.1.1.2.0.38 perseant-stdc-iso10646-base:1.1.1.2 prg-localcount2-base3:1.1.1.2 prg-localcount2-base2:1.1.1.2 prg-localcount2-base1:1.1.1.2 prg-localcount2:1.1.1.2.0.36 prg-localcount2-base:1.1.1.2 pgoyette-localcount-20170426:1.1.1.2 bouyer-socketcan-base1:1.1.1.2 pgoyette-localcount-20170320:1.1.1.2 bouyer-socketcan:1.1.1.2.0.34 bouyer-socketcan-base:1.1.1.2 pgoyette-localcount-20170107:1.1.1.2 pgoyette-localcount-20161104:1.1.1.2 localcount-20160914:1.1.1.2 pgoyette-localcount-20160806:1.1.1.2 pgoyette-localcount-20160726:1.1.1.2 pgoyette-localcount:1.1.1.2.0.32 pgoyette-localcount-base:1.1.1.2 netbsd-5-2-3-RELEASE:1.1.1.2 netbsd-5-1-5-RELEASE:1.1.1.2 yamt-pagecache-base9:1.1.1.2 yamt-pagecache-tag8:1.1.1.2 tls-earlyentropy:1.1.1.2.0.28 tls-earlyentropy-base:1.1.1.2 riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.1.1.2 riastradh-drm2-base3:1.1.1.2 netbsd-5-2-2-RELEASE:1.1.1.2 netbsd-5-1-4-RELEASE:1.1.1.2 netbsd-5-2-1-RELEASE:1.1.1.2 netbsd-5-1-3-RELEASE:1.1.1.2 agc-symver:1.1.1.2.0.30 agc-symver-base:1.1.1.2 tls-maxphys-base:1.1.1.2 yamt-pagecache-base8:1.1.1.2 netbsd-5-2:1.1.1.2.0.26 yamt-pagecache-base7:1.1.1.2 netbsd-5-2-RELEASE:1.1.1.2 netbsd-5-2-RC1:1.1.1.2 yamt-pagecache-base6:1.1.1.2 yamt-pagecache-base5:1.1.1.2 yamt-pagecache-base4:1.1.1.2 netbsd-5-1-2-RELEASE:1.1.1.2 netbsd-5-1-1-RELEASE:1.1.1.2 yamt-pagecache-base3:1.1.1.2 yamt-pagecache-base2:1.1.1.2 yamt-pagecache:1.1.1.2.0.24 yamt-pagecache-base:1.1.1.2 bouyer-quota2-nbase:1.1.1.2 bouyer-quota2:1.1.1.2.0.22 bouyer-quota2-base:1.1.1.2 matt-nb5-pq3:1.1.1.2.0.20 matt-nb5-pq3-base:1.1.1.2 netbsd-5-1:1.1.1.2.0.18 netbsd-5-1-RELEASE:1.1.1.2 netbsd-5-1-RC4:1.1.1.2 netbsd-5-1-RC3:1.1.1.2 netbsd-5-1-RC2:1.1.1.2 netbsd-5-1-RC1:1.1.1.2 netbsd-5-0-2-RELEASE:1.1.1.2 netbsd-5-0-1-RELEASE:1.1.1.2 jym-xensuspend-nbase:1.1.1.2 netbsd-5-0:1.1.1.2.0.16 netbsd-5-0-RELEASE:1.1.1.2 netbsd-5-0-RC4:1.1.1.2 netbsd-5-0-RC3:1.1.1.2 netbsd-5-0-RC2:1.1.1.2 jym-xensuspend:1.1.1.2.0.14 jym-xensuspend-base:1.1.1.2 netbsd-5-0-RC1:1.1.1.2 netbsd-5:1.1.1.2.0.12 netbsd-5-base:1.1.1.2 mjf-devfs2:1.1.1.2.0.10 mjf-devfs2-base:1.1.1.2 yamt-pf42-base4:1.1.1.2 yamt-pf42-base3:1.1.1.2 hpcarm-cleanup-nbase:1.1.1.2 yamt-pf42-base2:1.1.1.2 yamt-pf42:1.1.1.2.0.8 yamt-pf42-base:1.1.1.2 keiichi-mipv6:1.1.1.2.0.6 keiichi-mipv6-base:1.1.1.2 cube-autoconf:1.1.1.2.0.4 cube-autoconf-base:1.1.1.2 hpcarm-cleanup:1.1.1.2.0.2 hpcarm-cleanup-base:1.1.1.2 netbsd-0-8:1.1.1.1 netbsd-alpha-1:1.1.1.1 patchkit-0-2-2:1.1.1.1 WFJ-386bsd-01:1.1.1.1 WFJ-920714:1.1.1; locks; strict; comment @# @; 1.1 date 93.03.21.09.45.37; author cgd; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 93.03.21.09.45.37; author cgd; state Exp; branches; next 1.1.1.2; 1.1.1.2 date 93.07.07.17.26.32; author mycroft; state dead; branches; next ; desc @@ 1.1 log @Initial revision @ text @[ N.B. This bug strikes on a Sun 3 running SunOS 4 with the cc -O4 option as well as on the sparc. -Mike ] Date: Fri, 24 Feb 89 15:36:40 -0600 To: mike@@wheaties.ai.mit.edu From: Dave Cohrs Subject: bug + fix in gnu grep 1.2 (from prep.ai.mit.edu) I tried installing the GNU grep 1.2 on a Sun4 running 4.0.1 and "Spencer test #36" failed. After some experimenting, I found and fixed the bug. Well, actually, the bug in the the C compiler, but I managed a workaround. Description: The Sun4 4.0.1 C compiler with -O doesn't generate the correct for statements of the form if("string") x; else y; To be exact, "y;" gets executed, while "x;" should. This causes the #define FETCH() to fail for test #36. Fix: In an #ifdef sparc in dfa.c, I made two versions of FETCH, FETCH0() and the regular FETCH(). The former takes only one argument, the latter expects its 2nd argument to contain a non-nil string. This removes the need to test the constant strings, and the compiler bug isn't exercised. I then changed the one instance of FETCH() with a nil second argument to be FETCH0() instead. dave cohrs =================================================================== RCS file: RCS/dfa.c,v retrieving revision 1.1 diff -c -r1.1 dfa.c *** /tmp/,RCSt1a05930 Fri Feb 24 15:32:33 1989 --- dfa.c Fri Feb 24 15:23:34 1989 *************** *** 285,293 **** --- 285,315 ---- is turned off). */ /* Note that characters become unsigned here. */ + #ifdef sparc + /* + * Sun4 4.0.1 C compiler can't compare constant strings correctly. + * e.g. if("test") { x; } else { y; } + * the compiler will not generate code to execute { x; }, but + * executes { y; } instead. + */ + #define FETCH0(c) \ + { \ + if (! lexleft) \ + return _END; \ + (c) = (unsigned char) *lexptr++; \ + --lexleft; \ + } #define FETCH(c, eoferr) \ { \ if (! lexleft) \ + regerror(eoferr); \ + (c) = (unsigned char) *lexptr++; \ + --lexleft; \ + } + #else + #define FETCH(c, eoferr) \ + { \ + if (! lexleft) \ if (eoferr) \ regerror(eoferr); \ else \ *************** *** 295,300 **** --- 317,323 ---- (c) = (unsigned char) *lexptr++; \ --lexleft; \ } + #endif sparc static _token lex() *************** *** 303,309 **** --- 326,336 ---- int invert; _charset cset; + #ifdef sparc + FETCH0(c); + #else FETCH(c, (char *) 0); + #endif sparc switch (c) { case '^': @ 1.1.1.1 log @initial import of 386bsd-0.1 sources @ text @@ 1.1.1.2 log @Clean up deleted files. @ text @@