* PING: PATCH [8/n]: Prepare x32: PR other/48007: Unwind library doesn't work with UNITS_PER_WORD > sizeof (void *)
@ 2011-07-06 21:21 H.J. Lu
2011-07-11 22:53 ` H.J. Lu
0 siblings, 1 reply; 4+ messages in thread
From: H.J. Lu @ 2011-07-06 21:21 UTC (permalink / raw)
To: Richard Henderson; +Cc: Rainer Orth, Jason Merrill, gcc-patches, Jakub Jelinek
PING.
On Thu, Jun 30, 2011 at 1:47 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Thu, Jun 30, 2011 at 12:02 PM, Richard Henderson <rth@redhat.com> wrote:
>> On 06/30/2011 11:23 AM, H.J. Lu wrote:
>>> +#ifdef REG_VALUE_IN_UNWIND_CONTEXT
>>> +typedef _Unwind_Word _Unwind_Context_Reg_Val;
>>> +/* Signal frame context. */
>>> +#define SIGNAL_FRAME_BIT ((_Unwind_Word) 1 >> 0)
>>
>> There's absolutely no reason to re-define this.
>> So what if the value is most-significant-bit set?
>>
>> Nor do I see any reason not to continue setting E_C_B.
>
> Done.
>
>>> +#define _Unwind_IsExtendedContext(c) 1
>>
>> Why is this not still an inline function?
>
> It is defined before _Unwind_Context is declared. I used
> macros so that there can be one less "#ifdef".
>
>>> +
>>> +static inline _Unwind_Word
>>> +_Unwind_Get_Unwind_Word (_Unwind_Context_Reg_Val val)
>>> +{
>>> + return val;
>>> +}
>>> +
>>> +static inline _Unwind_Context_Reg_Val
>>> +_Unwind_Get_Unwind_Context_Reg_Val (_Unwind_Word val)
>>> +{
>>> + return val;
>>> +}
>>
>> I cannot believe this actually works. I see nowhere that
>> you copy the by-address slot out of the stack frame and
>> place it into the by-value slot in the unwind context.
>
> I changed the implantation based on the feedback from
> Jason. Now I use the same reg field for both value and
> address.
>
>>> /* This will segfault if the register hasn't been saved. */
>>> if (size == sizeof(_Unwind_Ptr))
>>> - return * (_Unwind_Ptr *) ptr;
>>> + return * (_Unwind_Ptr *) (_Unwind_Internal_Ptr) val;
>>> else
>>> {
>>> gcc_assert (size == sizeof(_Unwind_Word));
>>> - return * (_Unwind_Word *) ptr;
>>> + return * (_Unwind_Word *) (_Unwind_Internal_Ptr) val;
>>> }
>>
>> Indeed, this section is both wrong and belies the change
>> you purport to make.
>>
>> You didn't even test this, did you?
>>
>
> Here is the updated patch. It works on simple tests.
> I am running full tests. I kept config/i386/value-unwind.h
> since libgcc/md-unwind-support.h is included too late
> in unwind-dw2.c and I don't want to move it to be on
> the safe side.
>
> OK for trunk?
>
> Thanks.
>
> --
> H.J.
> ---
> gcc/
>
> 2011-06-30 H.J. Lu <hongjiu.lu@intel.com>
>
> * config.gcc (libgcc_tm_file): Add i386/value-unwind.h for
> Linux/x86.
>
> * system.h (REG_VALUE_IN_UNWIND_CONTEXT): Poisoned.
>
> * unwind-dw2.c (_Unwind_Context_Reg_Val): New.
> (_Unwind_Get_Unwind_Word): Likewise.
> (_Unwind_Get_Unwind_Context_Reg_Val): Likewise.
> (_Unwind_Context): Use _Unwind_Context_Reg_Val on the reg field.
> (_Unwind_IsExtendedContext): Defined as macro.
> (_Unwind_GetGR): Updated.
> (_Unwind_SetGR): Likewise.
> (_Unwind_GetGRPtr): Likewise.
> (_Unwind_SetGRPtr): Likewise.
> (_Unwind_SetGRValue): Likewise.
> (_Unwind_GRByValue): Likewise.
> (__frame_state_for): Likewise.
> (uw_install_context_1): Likewise.
>
> * doc/tm.texi.in: Document REG_VALUE_IN_UNWIND_CONTEXT.
> * doc/tm.texi: Regenerated.
>
> libgcc/
>
> 2011-06-30 H.J. Lu <hongjiu.lu@intel.com>
>
> * config/i386/value-unwind.h: New.
>
--
H.J.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: PING: PATCH [8/n]: Prepare x32: PR other/48007: Unwind library doesn't work with UNITS_PER_WORD > sizeof (void *)
2011-07-06 21:21 PING: PATCH [8/n]: Prepare x32: PR other/48007: Unwind library doesn't work with UNITS_PER_WORD > sizeof (void *) H.J. Lu
@ 2011-07-11 22:53 ` H.J. Lu
2011-07-28 22:32 ` H.J. Lu
0 siblings, 1 reply; 4+ messages in thread
From: H.J. Lu @ 2011-07-11 22:53 UTC (permalink / raw)
To: Richard Henderson; +Cc: Rainer Orth, Jason Merrill, gcc-patches, Jakub Jelinek
Ping.
On Wed, Jul 6, 2011 at 2:20 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> PING.
>
> On Thu, Jun 30, 2011 at 1:47 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> On Thu, Jun 30, 2011 at 12:02 PM, Richard Henderson <rth@redhat.com> wrote:
>>> On 06/30/2011 11:23 AM, H.J. Lu wrote:
>>>> +#ifdef REG_VALUE_IN_UNWIND_CONTEXT
>>>> +typedef _Unwind_Word _Unwind_Context_Reg_Val;
>>>> +/* Signal frame context. */
>>>> +#define SIGNAL_FRAME_BIT ((_Unwind_Word) 1 >> 0)
>>>
>>> There's absolutely no reason to re-define this.
>>> So what if the value is most-significant-bit set?
>>>
>>> Nor do I see any reason not to continue setting E_C_B.
>>
>> Done.
>>
>>>> +#define _Unwind_IsExtendedContext(c) 1
>>>
>>> Why is this not still an inline function?
>>
>> It is defined before _Unwind_Context is declared. I used
>> macros so that there can be one less "#ifdef".
>>
>>>> +
>>>> +static inline _Unwind_Word
>>>> +_Unwind_Get_Unwind_Word (_Unwind_Context_Reg_Val val)
>>>> +{
>>>> + return val;
>>>> +}
>>>> +
>>>> +static inline _Unwind_Context_Reg_Val
>>>> +_Unwind_Get_Unwind_Context_Reg_Val (_Unwind_Word val)
>>>> +{
>>>> + return val;
>>>> +}
>>>
>>> I cannot believe this actually works. I see nowhere that
>>> you copy the by-address slot out of the stack frame and
>>> place it into the by-value slot in the unwind context.
>>
>> I changed the implantation based on the feedback from
>> Jason. Now I use the same reg field for both value and
>> address.
>>
>>>> /* This will segfault if the register hasn't been saved. */
>>>> if (size == sizeof(_Unwind_Ptr))
>>>> - return * (_Unwind_Ptr *) ptr;
>>>> + return * (_Unwind_Ptr *) (_Unwind_Internal_Ptr) val;
>>>> else
>>>> {
>>>> gcc_assert (size == sizeof(_Unwind_Word));
>>>> - return * (_Unwind_Word *) ptr;
>>>> + return * (_Unwind_Word *) (_Unwind_Internal_Ptr) val;
>>>> }
>>>
>>> Indeed, this section is both wrong and belies the change
>>> you purport to make.
>>>
>>> You didn't even test this, did you?
>>>
>>
>> Here is the updated patch. It works on simple tests.
>> I am running full tests. I kept config/i386/value-unwind.h
>> since libgcc/md-unwind-support.h is included too late
>> in unwind-dw2.c and I don't want to move it to be on
>> the safe side.
>>
>> OK for trunk?
>>
>> Thanks.
>>
>> --
>> H.J.
>> ---
>> gcc/
>>
>> 2011-06-30 H.J. Lu <hongjiu.lu@intel.com>
>>
>> * config.gcc (libgcc_tm_file): Add i386/value-unwind.h for
>> Linux/x86.
>>
>> * system.h (REG_VALUE_IN_UNWIND_CONTEXT): Poisoned.
>>
>> * unwind-dw2.c (_Unwind_Context_Reg_Val): New.
>> (_Unwind_Get_Unwind_Word): Likewise.
>> (_Unwind_Get_Unwind_Context_Reg_Val): Likewise.
>> (_Unwind_Context): Use _Unwind_Context_Reg_Val on the reg field.
>> (_Unwind_IsExtendedContext): Defined as macro.
>> (_Unwind_GetGR): Updated.
>> (_Unwind_SetGR): Likewise.
>> (_Unwind_GetGRPtr): Likewise.
>> (_Unwind_SetGRPtr): Likewise.
>> (_Unwind_SetGRValue): Likewise.
>> (_Unwind_GRByValue): Likewise.
>> (__frame_state_for): Likewise.
>> (uw_install_context_1): Likewise.
>>
>> * doc/tm.texi.in: Document REG_VALUE_IN_UNWIND_CONTEXT.
>> * doc/tm.texi: Regenerated.
>>
>> libgcc/
>>
>> 2011-06-30 H.J. Lu <hongjiu.lu@intel.com>
>>
>> * config/i386/value-unwind.h: New.
>>
>
>
>
> --
> H.J.
>
--
H.J.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: PING: PATCH [8/n]: Prepare x32: PR other/48007: Unwind library doesn't work with UNITS_PER_WORD > sizeof (void *)
2011-07-11 22:53 ` H.J. Lu
@ 2011-07-28 22:32 ` H.J. Lu
2011-08-02 15:53 ` H.J. Lu
0 siblings, 1 reply; 4+ messages in thread
From: H.J. Lu @ 2011-07-28 22:32 UTC (permalink / raw)
To: Richard Henderson; +Cc: Jason Merrill, GCC Patches
Hi Richard, Jason,
Is this patch
http://gcc.gnu.org/ml/gcc-patches/2011-06/msg02401.html
OK for trunk?
Thanks.
H.J.
On Mon, Jul 11, 2011 at 3:21 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> Ping.
>
> On Wed, Jul 6, 2011 at 2:20 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> PING.
>>
>> On Thu, Jun 30, 2011 at 1:47 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>>> On Thu, Jun 30, 2011 at 12:02 PM, Richard Henderson <rth@redhat.com> wrote:
>>>> On 06/30/2011 11:23 AM, H.J. Lu wrote:
>>>>> +#ifdef REG_VALUE_IN_UNWIND_CONTEXT
>>>>> +typedef _Unwind_Word _Unwind_Context_Reg_Val;
>>>>> +/* Signal frame context. */
>>>>> +#define SIGNAL_FRAME_BIT ((_Unwind_Word) 1 >> 0)
>>>>
>>>> There's absolutely no reason to re-define this.
>>>> So what if the value is most-significant-bit set?
>>>>
>>>> Nor do I see any reason not to continue setting E_C_B.
>>>
>>> Done.
>>>
>>>>> +#define _Unwind_IsExtendedContext(c) 1
>>>>
>>>> Why is this not still an inline function?
>>>
>>> It is defined before _Unwind_Context is declared. I used
>>> macros so that there can be one less "#ifdef".
>>>
>>>>> +
>>>>> +static inline _Unwind_Word
>>>>> +_Unwind_Get_Unwind_Word (_Unwind_Context_Reg_Val val)
>>>>> +{
>>>>> + return val;
>>>>> +}
>>>>> +
>>>>> +static inline _Unwind_Context_Reg_Val
>>>>> +_Unwind_Get_Unwind_Context_Reg_Val (_Unwind_Word val)
>>>>> +{
>>>>> + return val;
>>>>> +}
>>>>
>>>> I cannot believe this actually works. I see nowhere that
>>>> you copy the by-address slot out of the stack frame and
>>>> place it into the by-value slot in the unwind context.
>>>
>>> I changed the implantation based on the feedback from
>>> Jason. Now I use the same reg field for both value and
>>> address.
>>>
>>>>> /* This will segfault if the register hasn't been saved. */
>>>>> if (size == sizeof(_Unwind_Ptr))
>>>>> - return * (_Unwind_Ptr *) ptr;
>>>>> + return * (_Unwind_Ptr *) (_Unwind_Internal_Ptr) val;
>>>>> else
>>>>> {
>>>>> gcc_assert (size == sizeof(_Unwind_Word));
>>>>> - return * (_Unwind_Word *) ptr;
>>>>> + return * (_Unwind_Word *) (_Unwind_Internal_Ptr) val;
>>>>> }
>>>>
>>>> Indeed, this section is both wrong and belies the change
>>>> you purport to make.
>>>>
>>>> You didn't even test this, did you?
>>>>
>>>
>>> Here is the updated patch. It works on simple tests.
>>> I am running full tests. I kept config/i386/value-unwind.h
>>> since libgcc/md-unwind-support.h is included too late
>>> in unwind-dw2.c and I don't want to move it to be on
>>> the safe side.
>>>
>>> OK for trunk?
>>>
>>> Thanks.
>>>
>>> --
>>> H.J.
>>> ---
>>> gcc/
>>>
>>> 2011-06-30 H.J. Lu <hongjiu.lu@intel.com>
>>>
>>> * config.gcc (libgcc_tm_file): Add i386/value-unwind.h for
>>> Linux/x86.
>>>
>>> * system.h (REG_VALUE_IN_UNWIND_CONTEXT): Poisoned.
>>>
>>> * unwind-dw2.c (_Unwind_Context_Reg_Val): New.
>>> (_Unwind_Get_Unwind_Word): Likewise.
>>> (_Unwind_Get_Unwind_Context_Reg_Val): Likewise.
>>> (_Unwind_Context): Use _Unwind_Context_Reg_Val on the reg field.
>>> (_Unwind_IsExtendedContext): Defined as macro.
>>> (_Unwind_GetGR): Updated.
>>> (_Unwind_SetGR): Likewise.
>>> (_Unwind_GetGRPtr): Likewise.
>>> (_Unwind_SetGRPtr): Likewise.
>>> (_Unwind_SetGRValue): Likewise.
>>> (_Unwind_GRByValue): Likewise.
>>> (__frame_state_for): Likewise.
>>> (uw_install_context_1): Likewise.
>>>
>>> * doc/tm.texi.in: Document REG_VALUE_IN_UNWIND_CONTEXT.
>>> * doc/tm.texi: Regenerated.
>>>
>>> libgcc/
>>>
>>> 2011-06-30 H.J. Lu <hongjiu.lu@intel.com>
>>>
>>> * config/i386/value-unwind.h: New.
>>>
>>
>>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: PING: PATCH [8/n]: Prepare x32: PR other/48007: Unwind library doesn't work with UNITS_PER_WORD > sizeof (void *)
2011-07-28 22:32 ` H.J. Lu
@ 2011-08-02 15:53 ` H.J. Lu
0 siblings, 0 replies; 4+ messages in thread
From: H.J. Lu @ 2011-08-02 15:53 UTC (permalink / raw)
To: Richard Henderson; +Cc: Jason Merrill, GCC Patches
PING.
On Thu, Jul 28, 2011 at 3:01 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> Hi Richard, Jason,
>
> Is this patch
>
> http://gcc.gnu.org/ml/gcc-patches/2011-06/msg02401.html
>
> OK for trunk?
>
> Thanks.
>
>
> H.J.
> On Mon, Jul 11, 2011 at 3:21 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> Ping.
>>
>> On Wed, Jul 6, 2011 at 2:20 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>>> PING.
>>>
>>> On Thu, Jun 30, 2011 at 1:47 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>>>> On Thu, Jun 30, 2011 at 12:02 PM, Richard Henderson <rth@redhat.com> wrote:
>>>>> On 06/30/2011 11:23 AM, H.J. Lu wrote:
>>>>>> +#ifdef REG_VALUE_IN_UNWIND_CONTEXT
>>>>>> +typedef _Unwind_Word _Unwind_Context_Reg_Val;
>>>>>> +/* Signal frame context. */
>>>>>> +#define SIGNAL_FRAME_BIT ((_Unwind_Word) 1 >> 0)
>>>>>
>>>>> There's absolutely no reason to re-define this.
>>>>> So what if the value is most-significant-bit set?
>>>>>
>>>>> Nor do I see any reason not to continue setting E_C_B.
>>>>
>>>> Done.
>>>>
>>>>>> +#define _Unwind_IsExtendedContext(c) 1
>>>>>
>>>>> Why is this not still an inline function?
>>>>
>>>> It is defined before _Unwind_Context is declared. I used
>>>> macros so that there can be one less "#ifdef".
>>>>
>>>>>> +
>>>>>> +static inline _Unwind_Word
>>>>>> +_Unwind_Get_Unwind_Word (_Unwind_Context_Reg_Val val)
>>>>>> +{
>>>>>> + return val;
>>>>>> +}
>>>>>> +
>>>>>> +static inline _Unwind_Context_Reg_Val
>>>>>> +_Unwind_Get_Unwind_Context_Reg_Val (_Unwind_Word val)
>>>>>> +{
>>>>>> + return val;
>>>>>> +}
>>>>>
>>>>> I cannot believe this actually works. I see nowhere that
>>>>> you copy the by-address slot out of the stack frame and
>>>>> place it into the by-value slot in the unwind context.
>>>>
>>>> I changed the implantation based on the feedback from
>>>> Jason. Now I use the same reg field for both value and
>>>> address.
>>>>
>>>>>> /* This will segfault if the register hasn't been saved. */
>>>>>> if (size == sizeof(_Unwind_Ptr))
>>>>>> - return * (_Unwind_Ptr *) ptr;
>>>>>> + return * (_Unwind_Ptr *) (_Unwind_Internal_Ptr) val;
>>>>>> else
>>>>>> {
>>>>>> gcc_assert (size == sizeof(_Unwind_Word));
>>>>>> - return * (_Unwind_Word *) ptr;
>>>>>> + return * (_Unwind_Word *) (_Unwind_Internal_Ptr) val;
>>>>>> }
>>>>>
>>>>> Indeed, this section is both wrong and belies the change
>>>>> you purport to make.
>>>>>
>>>>> You didn't even test this, did you?
>>>>>
>>>>
>>>> Here is the updated patch. It works on simple tests.
>>>> I am running full tests. I kept config/i386/value-unwind.h
>>>> since libgcc/md-unwind-support.h is included too late
>>>> in unwind-dw2.c and I don't want to move it to be on
>>>> the safe side.
>>>>
>>>> OK for trunk?
>>>>
>>>> Thanks.
>>>>
>>>> --
>>>> H.J.
>>>> ---
>>>> gcc/
>>>>
>>>> 2011-06-30 H.J. Lu <hongjiu.lu@intel.com>
>>>>
>>>> * config.gcc (libgcc_tm_file): Add i386/value-unwind.h for
>>>> Linux/x86.
>>>>
>>>> * system.h (REG_VALUE_IN_UNWIND_CONTEXT): Poisoned.
>>>>
>>>> * unwind-dw2.c (_Unwind_Context_Reg_Val): New.
>>>> (_Unwind_Get_Unwind_Word): Likewise.
>>>> (_Unwind_Get_Unwind_Context_Reg_Val): Likewise.
>>>> (_Unwind_Context): Use _Unwind_Context_Reg_Val on the reg field.
>>>> (_Unwind_IsExtendedContext): Defined as macro.
>>>> (_Unwind_GetGR): Updated.
>>>> (_Unwind_SetGR): Likewise.
>>>> (_Unwind_GetGRPtr): Likewise.
>>>> (_Unwind_SetGRPtr): Likewise.
>>>> (_Unwind_SetGRValue): Likewise.
>>>> (_Unwind_GRByValue): Likewise.
>>>> (__frame_state_for): Likewise.
>>>> (uw_install_context_1): Likewise.
>>>>
>>>> * doc/tm.texi.in: Document REG_VALUE_IN_UNWIND_CONTEXT.
>>>> * doc/tm.texi: Regenerated.
>>>>
>>>> libgcc/
>>>>
>>>> 2011-06-30 H.J. Lu <hongjiu.lu@intel.com>
>>>>
>>>> * config/i386/value-unwind.h: New.
>>>>
>>>
>>>
>
--
H.J.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-08-02 15:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-06 21:21 PING: PATCH [8/n]: Prepare x32: PR other/48007: Unwind library doesn't work with UNITS_PER_WORD > sizeof (void *) H.J. Lu
2011-07-11 22:53 ` H.J. Lu
2011-07-28 22:32 ` H.J. Lu
2011-08-02 15:53 ` H.J. Lu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).