🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #51532

Re: gcc suggestion

#51532
From: Garrett Wollman
Date: Sat, 01 May 1993 19:25
28 lines
2152 bytes
In article <1rs3rb$1bp@almaak.usc.edu> ajayshah@almaak.usc.edu (Ajay Shah) writes:
>These details will vary from one compiler to the next, of course, but
>I don't forsee ever using a C compiler other than gcc, and I'm sure
>many others are in the same situation.

Not only from compiler to compiler: many optimizations vary from
processor to processor!  Just as an exmaple of what you as a
programmer can do, if you are writing for the i386 family, it is
Received Wisdom that you should avoid using `unsigned short', because
the definition of Standard C requires this type to be promoted to
`signed int' in most contexts.  The result is that GCC ends up
emitting a lot of slow sign-/zero-extension instructions (`movzwl'
rings a bell) when working on these types, which are avoided if you
use a full `unsigned int'.  (I'm certain you've read the discussions
on comp.lang.c about unsigned-preserving versus value-preserving
semantics.)

For this particular situation, it would be nice if GCC had a
`-funsigned-preserving' switch.  (A `-muse-halfword-ops' switch would
be nice, too.)

-GAWollman

-- 
Garrett A. Wollman   | Shashish is simple, it's discreet, it's brief. ... 
wollman@emba.uvm.edu | Shashish is the bonding of hearts in spite of distance.
uvm-gen!wollman      | It is a bond more powerful than absence.  We like people
UVM disagrees.       | who like Shashish.  - Claude McKenzie + Florent Vollant
Technical Details
Message-ID: <1993May1.192516.15296@uvm.edu>
Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!noc.near.net!uunet!emba-news.uvm.edu!sadye.emba.uvm.edu!wollman
References: <1rs3rb$1bp@almaak.usc.edu>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,e4b251dc276f69b7
X-Google-Attributes: gid11318c,public
X-Google-Thread: 1025b4,e4b251dc276f69b7
X-Google-Attributes: gid1025b4,public
X-Google-ArrivalTime: 1993-05-01 12:42:38 PST
Newsgroups: gnu.gcc.help,gnu.misc.discuss
Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!noc.near.net!uunet!emba-news.uvm.edu!sadye.emba.uvm.edu!wollman
From: wollman@sadye.emba.uvm.edu (Garrett Wollman)
Subject: Re: gcc suggestion
Message-ID: <1993May1.192516.15296@uvm.edu>
Sender: news@uvm.edu
Organization: University of Vermont, EMBA Computer Facility
References: <1rs3rb$1bp@almaak.usc.edu>
Date: Sat, 1 May 1993 19:25:16 GMT
Lines: 28