public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* sibcall bug in ss-20000724 for i686-pc-linux
@ 2000-07-31 11:52 Thomas R. Truscott
  0 siblings, 0 replies; only message in thread
From: Thomas R. Truscott @ 2000-07-31 11:52 UTC (permalink / raw)
  To: gcc-bugs

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);
}
>From aoliva@redhat.com Mon Jul 31 12:10:00 2000
From: Alexandre Oliva <aoliva@redhat.com>
To: Phil Edwards <pedwards@disaster.jaj.com>
Cc: gcc-bugs@gcc.gnu.org
Subject: Re: sed: command garbled
Date: Mon, 31 Jul 2000 12:10:00 -0000
Message-id: <orittmf75b.fsf@guarana.lsd.ic.unicamp.br>
References: <200007311746.NAA32639@disaster.jaj.com>
X-SW-Source: 2000-07/msg00783.html
Content-length: 500

On Jul 31, 2000, Phil Edwards <pedwards@disaster.jaj.com> wrote:

> breaks a build when libstdc++-v3 is enabled:

Yup, I've already posted another patch that addresses this problem.
Thanks for your bug report.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-07-31 11:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-07-31 11:52 sibcall bug in ss-20000724 for i686-pc-linux Thomas R. Truscott

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).