This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: unwind and type support in GCC47
- From: Ian Lance Taylor <iant at google dot com>
- To: "Paulo J. Matos" <paulo at matos-sorge dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 03 Apr 2012 07:04:39 -0700
- Subject: Re: unwind and type support in GCC47
- References: <jl1sr9$1s7$1@dough.gmane.org> <mcr398qenj4.fsf@dhcp-172-18-216-180.mtv.corp.google.com> <jlesn1$bl5$1@dough.gmane.org>
"Paulo J. Matos" <paulo@matos-sorge.com> 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__
instead.
Ian