g++ Bug? use of alloca in a function prevents exception handler walkback on ppc linux

Franz Sirl Franz.Sirl-kernel@lauterbach.com
Thu Dec 14 14:30:00 GMT 2000


On Thursday 14 December 2000 19:12, Geoff Keating wrote:
> > From: "Kevin B. Hendricks" <kevin.hendricks@sympatico.ca>
> > Reply-To: khendricks@ivey.uwo.ca
> > Date: Thu, 14 Dec 2000 11:40:27 -0500
> >
> > With a lot of help from Philipp Lohmann from Sun Germany, we have
> > tracked the problem on ppc linux exception handling to the use of
> > alloca in any function in the path back to the exception handler.
> >
> > This is what causes the "pc" in throw_helper to point out into the weeds.
> >
> > Is this a g++ bug?
>
> It's a libgcc bug.

But hard to fix?

> > Should dynamic allocation of stack space prevent the search back through
> > the function by throw_helper?
>
> No.
>
> > Any guidance about how to deal with this would be greatly appreciated.
>
> It's a known bug.  The following workaround is a temporary patch, but
> it causes a performance regression for C++.  The correct fix is to
> improve libgcc so that it can deal with this case.

Your patch is against the current mainline, but mainline compiles a correctly 
throwing binary with Kevin's testcase. Do you have another testcase or is the 
current mainline already fixed and your patch superflous now? If it is fixed, 
it must have happened recently, since the 20001106 compiler still produced a 
failing binary.

Anyway, Kevin is working with gcc-2.95.3 so I'll look into backporting your 
fix, cause I don't have time to do gcc-2.97 RPM's before xmas.

Franz.


More information about the Gcc mailing list