This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
sibcall bug in ss-20000724 for i686-pc-linux
- To: gcc-bugs at gcc dot gnu dot org
- Subject: sibcall bug in ss-20000724 for i686-pc-linux
- From: "Thomas R. Truscott" <trt at cs dot duke dot edu>
- Date: Mon, 31 Jul 2000 14:52:22 -0400 (EDT)
In the program below, the optimizer turns do_sibcall's "call foo"
into "branch foo". Unforunately for ia32, foo
returns a double that is pushed onto the floating point stack
and the caller must clean that up.
That would happen if do_sibcall also returned a double,
but alas it returns void.
On i686-pc-linux, "gcc -O2" does sibcall optimization
and the resulting program calls abort.
Tom Truscott
double
foo (void)
{
return 0.0;
}
void
do_sibcall (void)
{
(void) foo ();
}
int
main (void)
{
double x;
for (x = 0; x < 20; x++)
do_sibcall ();
if (!(x >= 10))
abort ();
exit (0);
}