🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #63

Re: Another Manx v3.6 bug

#63
From: C. Harald Koch
Date: Thu, 15 Jun 1989 22:04
22 lines
1717 bytes
In article <17762@usc.edu> addison@pollux.usc.edu (Richard Addison) writes:
>This brings up something that I've always found horribly stupid.  I've seen
>C compilers use ext.w (followed by ext.l if ints are long) to test to see if
>a char is equal to 0, or to compare two chars, or to add, subtract two chars
>when the result will end up in a char.  These are very clearly instances of
>unnecessary promotion:  the additional high-order bits will never effect the
>lower-order bits.

The easiest way to handle C expression compilation is to always promote to
the correct size, whether or not it is necessary. It is much more difficult
to make sure that an arbitrary expression doesn't require promotion, so few
compiler writers bother to implement this special case.

Of course, The GNU C compiler probably checks. That monstrosity does
everything short of buying you a new processor to get your code as small and
efficient as possible.

-- 
Grandpa Charnock's Law:	 | C. Harald Koch  NTT Systems, Inc., Toronto, Ontario
You never really learn	 | chk@gpu.utcs.utoronto.ca	   (long-term address)
to swear until you learn | chk@zorac.dciem.dnd.ca	      (my current job)
to drive.		 | chk@chkent.UUCP		    (my AMIGA at home)
Technical Details
Message-ID: <1829@client1.DRETOR.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!dciem!client1!chk
References: <14328@watdragon.waterloo.edu> <14395@watdragon.waterloo.edu> <17762@usc.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!dciem!client1!chk
From: chk@client1.DRETOR.UUCP (C. Harald Koch)
Newsgroups: comp.sys.amiga.tech
Subject: Re: Another Manx v3.6 bug
Keywords: code generation,C,stupid,corn flakes
Message-ID: <1829@client1.DRETOR.UUCP>
Date: 15 Jun 89 22:04:21 GMT
References: <14328@watdragon.waterloo.edu> <14395@watdragon.waterloo.edu> <17762@usc.edu>
Reply-To: chk@client1.dciem.dnd.ca (C. Harald Koch)
Organization: NTT Systems, Inc., Toronto, Canada
Lines: 22