This is the mail archive of the
guile@sources.redhat.com
mailing list for the Guile project.
Re: Subtle bug with GCC optimization?
Gary Houston <ghouston@arglist.com> writes:
> > From: Marius Vollmer <mvo@zagadka.ping.de>
> > Date: 16 Aug 2000 19:55:00 +0200
> >
> > Gary Houston <ghouston@arglist.com> writes:
> >
> > > It looks like the same GCC bug we ran into a few months ago: try adding
> > > -fno-gcse.
> >
> > Yes, indeed. Using -fno-gcse produces correct code. What did you do
> > to work around your instance of the bug?
>
> It was the "Crash in scm_boot_guile if stdin isn't open" problem: you
> helped find a fix for it. The gcse bug caused a SEGV instead of
> abort when the problem occured, so the work-around was to make the
> problem not occur.
Ah, yes, I remember. I have now fixed my problem by inserting this
#ifdef __GNUC__
/* GCC 2.95.2 has a bug in its optimizer that makes it generate
incorrect code sometimes. This barrier stops it from being too
clever. */
asm volatile ("" : "=g" (winds));
#endif
at a strategic place in scm_ithrow. I don't need to turn off gcse and
the rest of Guile is unaffected. The code for scm_ithrow seems to be
just as optimal, but I don't really care.