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: 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


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