🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #51082

Forcing call-by-reference in gcc-2.4.5

#51082
From: thx
Date: Tue, 29 Jun 1993 19:42
25 lines
1684 bytes
We are trying to compile a bunch of code which has some inconsistencies.

Some arguments are passed to subroutines as doubles. In the subroutine,
the argument is declared as a union of double and bytes so that the
subroutine can pick the argument apart.

The commercial compiler which we use passes the double in a register
and expects to see the union of size 8 bytes in a register, so there
is no problem. This is good for the production version.

We would like to be able to gdb the software on our workstations, but
gcc passes the double into the subroutine in a register and from inside
the subroutine it apparently expects the 8-byte union to be on the stack.

Apparently gcc does not put any structures into registers, even if it
will fit.

Is there a way to force the compiler to put doubles on the stack before
calling the subroutine, so the subroutine will find them there? All
the code is compiled with gcc.

Couldn't find anything in the gcc-info pages to help.

thanks,
tim werner
Technical Details
Message-ID: <1993Jun29.194239.9061@news.csuohio.edu>
Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!spool.mu.edu!nigel.msen.com!caen!malgudi.oar.net!news.uakron.edu!news.csuohio.edu!knuth.cba.csuohio.edu!thx1139

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,6a6237e49f4ce3f,start
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1993-06-29 13:07:26 PST
Newsgroups: gnu.gcc.help
Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!spool.mu.edu!nigel.msen.com!caen!malgudi.oar.net!news.uakron.edu!news.csuohio.edu!knuth.cba.csuohio.edu!thx1139
From: thx1139@knuth.cba.csuohio.edu (thx)
Subject: Forcing call-by-reference in gcc-2.4.5
Message-ID: <1993Jun29.194239.9061@news.csuohio.edu>
Sender: news@news.csuohio.edu (USENET News System)
Organization: Cleveland State University, Cleveland, Ohio
Date: Tue, 29 Jun 1993 19:42:39 GMT
Lines: 26