PATCH: PR other/48007: Unwind library doesn't work with UNITS_PER_WORD > sizeof (void *)

H.J. Lu hjl.tools@gmail.com
Mon Mar 7 00:15:00 GMT 2011


On Sun, Mar 6, 2011 at 3:40 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Sun, Mar 6, 2011 at 3:23 PM, Richard Guenther
> <richard.guenther@gmail.com> wrote:
>> On Sun, Mar 6, 2011 at 10:28 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>>> On Sun, Mar 6, 2011 at 1:15 PM, Andrew Pinski <pinskia@gmail.com> wrote:
>>>> On Sun, Mar 6, 2011 at 9:18 AM, H.J. Lu <hongjiu.lu@intel.com> wrote:
>>>>> Hi,
>>>>>
>>>>> We shouldn't save call frame hard registers as "void *".  This patch
>>>>> changes the unwind library to save call frame hard registers as
>>>>> _Unwind_Word.  OK for 4.7?
>>>>
>>>> I think this will break the ABI for the MIPS N32 ABI.  Not to mention
>>>> the MIPS N32 ABI works fine with the unwinding part this way.  Does
>>>> someone use the unwinding library to look at the registers in previous
>>>> stack frames?
>>>
>>> It may be psABI/implementation specific.  X32 glibc force unwind calls
>>> _Unwind_SetGRValue to get a 64bit register value.
>>
>> So fix it on that side?
>>
>
> How? One function in question is
>
> /* Overwrite the saved value for register INDEX in CONTEXT with VAL.  */
>
> static inline void
> _Unwind_SetGRValue (struct _Unwind_Context *context, int index,
>                    _Unwind_Word val)
>
>
> Are you saying it shouldn't be called if UNITS_PER_WORD > sizeof (void *)?
>

FWIW, the type of GR is _Unwind_Word, not void *.  They may not
have the same size.  Why does the DWARF unwind library use
void * to store GR? Can a target have an option to save a _Unwind_Word
value in _Unwind_Word, instead of void *?

Thanks.

-- 
H.J.



More information about the Gcc-patches mailing list