This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: Add current_fde to dwarf2out.c
On Tue, May 27, 2008 at 8:05 AM, Richard Guenther
<richard.guenther@gmail.com> wrote:
> On Tue, May 27, 2008 at 4:43 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> On Tue, May 27, 2008 at 07:04:21AM -0700, H.J. Lu wrote:
>>> > > +
>>> >
>>> > Please make this an accessor, like
>>> >
>>> > static inline dw_fde_ref *
>>> > current_fde (void)
>>> > {
>>> > return &fde_table[fde_table_in_use -1];
>>> > }
>>> >
>>> > and update other uses of the fde_table[fde_table_in_use - 1]. I would suggest
>>> > to split this patch from the series.
>>> >
>>>
>>> Hi Richard,
>>>
>>> An access function will lead to something like this. If it is the
>>> preferred style, we will submit a separate patch.
>>>
>>> Thanks.
>>>
>>>
>>
>> Hi Richard,
>>
>> How about this patch? I am testing it on Linux/Intel64. OK for trunk
>> if it passes?
>
> Is that all uses of this kind? I guess the assert could go in the
> accessor function instead. See also the reply to Joey, basically
> such patch is ok and pre-approved if it works.
>
There is
if (fde_table_in_use)
{
dw_fde_ref fde = &fde_table[fde_table_in_use - 1];
for (cfi = fde->dw_fde_cfi; cfi; cfi = cfi->dw_cfi_next)
lookup_cfa_1 (cfi, loc);
}
and there are many more like this on stack branch. If current_fde returns NULL
when fde_table_in_use is 0, we can do
fde = current_fde ();
if (fde && ...)
instead of
if (fde_table_in_use)
{
fde = current_fde ();
...
}
But I can go either way.
Thanks.
H.J.