Article View: gnu.gcc.help
Article #50132Need for -fpcc-struct-return
From: Jim Jagielski
Date: Tue, 16 Nov 1993 16:04
Date: Tue, 16 Nov 1993 16:04
34 lines
2309 bytes
2309 bytes
As I understand it, sometimes 'cc' and 'gcc' differ in how structs and
unions are returned/passed from/to functions. To assure that 'gcc' uses the
same technique for programs that do struct passing (like dbm), it's
recommended that -fpcc-struct-return is used. By according to the manual,
it looks as if by default 'gcc' does this:
-fpcc-struct-return
Use the same convention for returning struct and union
values that is used by the usual C compiler on your
system. This convention is less efficient for small
structures, and on many machines it fails to be reen-
trant; but it has the advantage of allowing intercalla-
bility between GCC-compiled code and PCC-compiled code.
-freg-struct-return
Use the convention that struct and union values are re-
turned in registers when possible. This is more effi-
cient for small structures than -fpcc-struct-return.
> If you specify neither -fpcc-struct-return nor
> -freg-struct-return, GNU CC defaults to whichever con-
> vention is standard for the target. If there is no
> standard convention, GNU CC defaults to
> -fpcc-struct-return.
Does the above apply to cross compiling only?
Thanks!
--
#include <std/disclaimer.h>
Jim Jagielski | "Come quietly or there will be...
jim@jagubox.gsfc.nasa.gov | trouble."
NASA/GSFC, Code 734.4 | Robocop
Greenbelt, MD 20771 |
Technical Details
Message-ID:
<2535@jagubox.gsfc.nasa.gov>Path:
arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!ames!skates.gsfc.nasa.gov!jagubox!jimShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,5e169b70a1064e95,start X-Google-Attributes: gid11318c,public X-Google-ArrivalTime: 1993-11-16 09:07:37 PST Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!ames!skates.gsfc.nasa.gov!jagubox!jim From: jim@jagubox.gsfc.nasa.gov (Jim Jagielski) Newsgroups: gnu.gcc.help Subject: Need for -fpcc-struct-return Date: 16 Nov 93 16:04:04 GMT Organization: NASA/Goddard Space Flight Center Lines: 34 Message-ID: <2535@jagubox.gsfc.nasa.gov> Reply-To: jim@jagubox.gsfc.nasa.gov (Jim Jagielski) NNTP-Posting-Host: jagubox.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit