This is the mail archive of the 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: unwind and type support in GCC47

"Paulo J. Matos" <> writes:

> On 30/03/12 05:11, Ian Lance Taylor wrote:
>> There really shouldn't be anything in the exception support that uses
>> SImode.  That would be a bug.  And I don't see anything that uses
>> SImode.  What are you looking at?  What I see is things that use mode
>> __unwind_word__, __word__, and __pointer__.  Those types are under the
>> control of your backend.
> I was mentioning these references to SI:
> unwind-pe.h:
> static const unsigned char *
> read_encoded_value_with_base (unsigned char encoding, _Unwind_Ptr base,
>                               const unsigned char *p, _Unwind_Ptr *val)
> {
>   union unaligned
>     {
>       void *ptr;
>       unsigned u2 __attribute__ ((mode (HI)));
>       unsigned u4 __attribute__ ((mode (SI)));
>       unsigned u8 __attribute__ ((mode (DI)));
>       signed s2 __attribute__ ((mode (HI)));
>       signed s4 __attribute__ ((mode (SI)));
>       signed s8 __attribute__ ((mode (DI)));
>     } __attribute__((__packed__));
> ...

Hmmm, you're right, I didn't notice those.  You said that on your system
QImode is 16 bits.  These modes are being used to efficiently load
16-bit, 32-bit, and 64-bit values, in order to handle DW_EH_PE_udata2
and friends.  This code is not portable in that it assumes 8 bit bytes
and 8 bit QImode.  But I don't know how to fix it.  What is the right
way to load a 16-bit or 32-bit value on your system?

> There are also some references to mode SI in unwind-dw2.c.
> And there's also this:
> unwind-dw2-fde.h:typedef          int  sword __attribute__ ((mode (SI)));
> Why hardcode these type sizes here?	

That just looks like a bug.  It should probably use __INT32_TYPE__


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