delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/04/17/12:12:58

From: dontmailme AT iname DOT com (Steamer)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: inefficiency of GCC output code & -O problem
Date: Mon, 17 Apr 2000 16:08:23 GMT
Organization: always disorganized
Lines: 22
Message-ID: <38fb36e6.25856106@news.freeserve.net>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1000417163323 DOT 17688D-100000 AT is> <8dfekp DOT 3vvqu6v DOT 0 AT buerssner-17104 DOT user DOT cis DOT dfn DOT de>
NNTP-Posting-Host: modem-125.maine.dialup.pol.co.uk
X-Trace: news8.svr.pol.co.uk 955987704 22687 62.137.70.125 (17 Apr 2000 16:08:24 GMT)
NNTP-Posting-Date: 17 Apr 2000 16:08:24 GMT
X-Complaints-To: abuse AT theplanet DOT net
X-Newsreader: Forte Free Agent 1.11/32.235
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Dieter Buerssner wrote:

>>> Also Watcom C/C++ has one very feature. It can generate code for
>>> register and stack based calling conventions. I.e. parameters may be
>>> passed either via stack or via registers. It also helps greatly.
>>
>>GCC has such a feature as well.  Read the on-line GCC manual about the 
>>"-mregparm" switch, for details.
>
>Certainly, gcc has such a feature. But it is (almost) unusable.
>When you call the library, the program will stop working. Recompiling
>the library won't help, because of the asm code.
>
>Other compilers circumvent the library problem by __cdecl or
>equivalent keywords in the header files.

But there is a regparm function attribute that can be used like
this (info gcc "c ext" "function at").  I haven't tried this,
because I've only just noticed it.  (I was looking for something
like this a while ago, but failed to find it.)

S.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019