This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: PR other/48007: Unwind library doesn't work with UNITS_PER_WORD > sizeof (void *)
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: iant at google dot com (Ian Lance Taylor)
- Cc: pinskia at gmail dot com (Andrew Pinski), jakub at redhat dot com (Jakub Jelinek), hjl dot tools at gmail dot com (H.J. Lu), gcc-patches at gcc dot gnu dot org (GCC Patches)
- Date: Tue, 22 Mar 2011 20:30:29 +0100 (CET)
- Subject: Re: PATCH: PR other/48007: Unwind library doesn't work with UNITS_PER_WORD > sizeof (void *)
Ian Lance Taylor wrote:
> Andrew Pinski <pinskia@gmail.com> writes:
> > On Tue, Mar 22, 2011 at 9:42 AM, Ian Lance Taylor <iant@google.com> wrote:
> >>
> >> Any target on which _Unwind_Word is larger than void * is broken today,
> >> so I don't think we need to care about that case.
> >
> > So a MIPS N32 is broken? Lots of people use that target already and
> > nothing like this has showed up yet.
>
> That is a fair question. It does seem to me that it must be broken in
> some cases. _Unwind_GetGRPtr will return &context->reg[index], which is
> a void** cast to void*. We will then pass that to _Unwind_SetGRPtr. If
> we later call _Unwind_SetGR on that register, it will write a value of
> size _Unwind_Word through that pointer. Similarly if we call
> _Unwind_GetGR, it will read a value of size _Unwind_Word. In both
> cases, we will be accessing a 4-byte field as an 8-byte value.
>
> If MIPS N32 works today, then something must be ensuring that that
> sequence can never occur, or that for some reason it never matters.
Well, the whole problem only occurs when using the "by value" mechanism,
which is only triggered by DW_CFA_val_... CFI statements, which are new
in Dwarf-3 and seem to be very rarely used: they are apparently never
generated by GCC, and the only files I could find in current glibc that
create such CFI by hand are Intel-specific.
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com