[PATCH] Fix __cxa_exception ABI breakage in 4.4 (PR libstdc++/38732)

Jakub Jelinek jakub@redhat.com
Wed Jan 7 18:16:00 GMT 2009


On Wed, Jan 07, 2009 at 06:53:58PM +0100, Paolo Carlini wrote:
> > Either we cast pointers to the end of all of these (the same) to
> > one of these structs, subtract one and then dereference fields in it,
> > or first add 1 to pointer to one of these structs (to get to the end)
> > and then cat/subtract.
> >   
> I see, if you could experiment a bit with that...

What I wrote is what we do.  So I don't know what should I experiment with.
I think we never access fields in __cxa_refcounted_exception,
__cxa_exception and _Unwind_Exception through 2 different pointers
in one function, but even if we would, this IMHO boils down to:

struct A { int i; struct B { short s; long l; } b; };

int foo (struct A *a, struct B *b)
{
  b->s = 3;
  a->b.s = 4;
  a->b.l = 7;
  b->l = 6;
  return b->s + a->b.l;
}
which is IMHO valid.

	Jakub



More information about the Gcc-patches mailing list