Article View: gnu.gcc.bug
Article #2310Bug in struct passing(?) on sun4os4, gcc1.33.
From: Paul Hudson
Date: Wed, 15 Feb 1989 11:26
Date: Wed, 15 Feb 1989 11:26
36 lines
1270 bytes
1270 bytes
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.
Technical Details
Message-ID:
<8902151126.AA25898@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. Message-ID: <8902151126.AA25898@marvin.moncam.uucp> Date: 15 Feb 89 11:26:45 GMT Article-I.D.: marvin.8902151126.AA25898 Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 36