Article View: gnu.gcc.bug
Article #2309Bug in struct passing(?) on sun4os4, gcc1.33. (and my address).
From: Paul Hudson
Date: Wed, 15 Feb 1989 11:27
Date: Wed, 15 Feb 1989 11:27
46 lines
1548 bytes
1548 bytes
(Sorry - forgot my address previously)
The following program should print
0 100 100 100 100 0
but instead prints
100 0 100 0 100 0
(the last argument 3 times (?))
struct p { float x, y; };
struct p make_p(float x, float y)
{
struct p r;
r.x = x;
r.y = y;
return r;
}
struct p return_p(struct p p)
{
return p;
}
void print_p(struct p p1, struct p p2, struct p p3)
{
printf("%g %g %g %g %g %g\n", p1.x, p1.y, p2.x, p2.y, p3.x, p3.y);
}
main()
{
print_p(return_p(make_p(0.0, 100.0)),
return_p(make_p(100.0, 100.0)),
return_p(make_p(100.0, 0.0)));
}
compiled with gcc -O. In general sparc gcc seems very fragile with struct args
and returns, which is unfortunate since that's the way I write code.
Paul Hudson
Snail mail: Monotype ADG Email: ...!ukc!acorn!moncam!paul
Science Park, paul@moncam.co.uk
Milton Road, "Sun Microsysytems:
Cambridge, The Company is Arrogant (TM)"
CB4 4FQ
Technical Details
Message-ID:
<8902151127.AA25921@marvin.moncam.uucp>Path:
arc1-ca.pugleaf.net!utzoo!yunexus!telly!attcan!dptcdc!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!UUNET.UU.NET!mcvax!moncam!paulShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!yunexus!telly!attcan!dptcdc!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!UUNET.UU.NET!mcvax!moncam!paul From: mcvax!moncam!paul@UUNET.UU.NET (Paul Hudson) Newsgroups: gnu.gcc.bug Subject: Bug in struct passing(?) on sun4os4, gcc1.33. (and my address). Message-ID: <8902151127.AA25921@marvin.moncam.uucp> Date: 15 Feb 89 11:27:22 GMT Article-I.D.: marvin.8902151127.AA25921 Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 46