This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Introduce abi_word_mode


Andreas Krebbel <Andreas.Krebbel@de.ibm.com> writes:

> I would like to work on a patch removing attribute(mode(word)) but currently 
> I don't see how the use of the attribute to define Unwind_Word can be replaced without 
> introducing another strange mechanism to statisfy all architectures.  If we would
> try to replace it with mode(SI) or mode(DI) I think we would have to add tons of 
> target macro checks to unwind.h to do the right thing for every back-end 
> configuration.  Basically we would have to mimic the logic used in each backend 
> to define UNITS_PER_WORD (except for rs6000 and the modified S/390 back-end of 
> course where we would do what abi_word_mode would do).

Most of the uses of _Unwind_Word and _Unwind_Sword are as local
variables in the unwind routines.  Those can be handled
straightforwardly.

The sizes in Dwarf2 EH information are specified, and those cases can
be handled with a bit more difficulty.

_Unwind_Exception is specified by the ABI.  Actually the ABI specifies
uint64 for private_1 and private_2, but that was designed for IA64,
and our code changes that to _Unwind_Word.  That structure is normally
used only by the exception routines themselves.  It is exposed by the
uses in libsupc++.  The size of private_1 and private_2 doesn't need
to be word_mode--it could be anything large enough to hold a pointer.
But there may be some backward compatibility issues here.

_SjLj_Function_Context needs to match the structure created in
init_eh, which uses word_mode.  If we change init_eh, I'm not sure
there are any backward compatibility issues with this, but there may
be.  This is where TARGET_EH_RETURN_FILTER_MODE comes in: it expresses
the size of the entries in data[] as seen by the unwind library.

The first step should probably be to eliminate most of the uses of
_Unwind_Word and _Unwind_Sword from the unwind code, and see what we
have left.  Most of the uses can be replaced with something akin to
uintptr_t and intptr_t.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]