Related articles |
---|
[14 earlier articles] |
Re: failure due to compiler? alain@phidani.be (Corchia Alain) (1996-07-15) |
Re: failure due to compiler? dave_sc@csl.sri.com (1996-07-15) |
Re: failure due to compiler? kanze@lts.sel.alcatel.de (1996-07-16) |
Re: failure due to compiler? glew@ichips.intel.com (1996-07-16) |
Re: failure due to compiler? WStreett@shell.monmouth.com (1996-07-16) |
Re: failure due to compiler? grout@polestar.csrd.uiuc.edu (1996-07-18) |
Re: failure due to compiler? gah@u.washington.edu (1996-07-19) |
Re: failure due to compiler? ok@cs.rmit.edu.au (1996-07-20) |
Re: failure due to compiler? LEEW@FS.MICROLOGIC.COM (Lee Webber) (1996-07-20) |
Re: failure due to compiler? iwm@doc.ic.ac.uk (Ian Moor) (1996-07-20) |
Re: failure due to compiler? WStreett@shell.monmouth.com (1996-07-20) |
Re: failure due to compiler? jgllgher@maths.tcd.ie (Dara Gallagher) (1996-07-20) |
Re: failure due to compiler? ok@cs.rmit.edu.au (1996-07-22) |
[9 later articles] |
From: | gah@u.washington.edu (G. Herrmannsfeldt) |
Newsgroups: | comp.compilers |
Date: | 19 Jul 1996 00:04:29 -0400 |
Organization: | University of Washington |
References: | 96-07-041 96-07-056 96-07-064 96-07-079 96-07-100 |
Keywords: | errors |
I think my usual favorite, though I can't remember any exact examples,
are ones that give the right answer only when extra debugging code is
added, or when using a debugger.
Especially optimizers can make large changes in generated code for small
changes in input data.
The only real examples I can remember are:
1) A C compiler that miscompiled double a; a++;
I don't remember what it did, but I checked (comp.lang.c) and ++ is legal
on double.
2) A C compiler that compiled switch(i++) as switch(++i),
but correctly compiled switch(++i).
I used to have some good examples from the IBM PL/I F compiler but I
don't remember them anymore.
-- glen
[Oh, well, PL/I F. I once tried to write a PDP-8 simulator in PL/I F
but found it was unable to generate correct code for 12 bit long
bit strings. (God evidently intended us to use 8 or 16 bit strings.)
And in a loop the insides of which were A(J) = 1 / (1.0 + 1.0i); , that is,
initialize all the entries in a float complex array to a complex constant,
the loop contained a decimal add instruction. It's amazing any PL/I
applications worked at all. -John]
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.