🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.acorn.tech
Article #461

Re: Bug found in v4 of Acorn C compiler

#461
From: Andy Duplain
Date: Thu, 01 Oct 1992 17:16
42 lines
2252 bytes
In article <1992Oct1.033932.22482@cs.aukuni.ac.nz> epoo1@cs.aukuni.ac.nz (Edouard Poor) writes:
>
>    value = ( ( ( ( WORD ) fgetByte() ) << 8 ) | fgetByte() );

	The following text is an extract from "Harbison and Steele, 3rd
	edition, page 207":
	
	"In general, the compiler can rearrange the order in which an
	expression is evaluated.  The rearrangement may consist of evaluating
	only the arguments of a function call, or the two operands of a
	binary operator, in some particular order other than the obvious
	left-to-right order.  The binary operators +, *, &, ^ and | are
	assumed to be completely associative and commutative, and the
	compiler is permitted to exploit this assumption".
	
>One genuine bug.

	Wrong.

>(I suspect it's the optimisers fault myself...) 

	Wrong.

>Minor Flame Start {
>Can anyone think of any good reason why the optimiser is permanantly ON in
>the C compiler? Every other C compiler on the planet has the optimiser as an
>optional command line flag... Is it really just to make the dhrystone results
>look better (as the benchmark specifies that the compiler should be run in
>it's default state--optimiser off for everyone else, but on for the Acorn one)
>} Minor Flame End
>	       
	The Microsoft C compiler has "some" optimisations on by default
	(you may turn all optimisation on, or all off, from the command line).
	I _guess_ it may be to do with debugging information; the GNU C
	compiler is capable to generating optmised code _with_ source level
	debugging information, while others mutually exclude '-O' and '-g'...
	maybe Acorn C v4 can do both, like gcc ? 
	Anyway, why is it a problem ?  compile time ?
	
-- 
Andy Duplain, BT Customer Systems, Brighton, UK.            duplain@rtf.bt.co.uk
#define	DISCLAIMER      My views and opinions are my own, and not my company's
Technical Details
Message-ID: <1992Oct1.171634.27122@rtf.bt.co.uk>
Path: arc1-ca.pugleaf.net!sparky!uunet!pipex!unipalm!uknet!axion!rtf.bt.co.uk!duplain
References: <1992Oct1.033932.22482@cs.aukuni.ac.nz>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!pipex!unipalm!uknet!axion!rtf.bt.co.uk!duplain
From: duplain@rtf.bt.co.uk (Andy Duplain)
Newsgroups: comp.sys.acorn.tech
Subject: Re: Bug found in v4 of Acorn C compiler
Message-ID: <1992Oct1.171634.27122@rtf.bt.co.uk>
Date: 1 Oct 92 17:16:34 GMT
References: <1992Oct1.033932.22482@cs.aukuni.ac.nz>
Organization: BT Customer Systems, Brighton, UK
Lines: 42