This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [trunk<-vta] Re: [vta] fix PCH testsuite regression with DW_AT_MIPS_linkage_name
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 03 Jun 2009 17:08:36 -0300
- Subject: Re: [trunk<-vta] Re: [vta] fix PCH testsuite regression with DW_AT_MIPS_linkage_name
- References: <orabbo5qef.fsf@livre.oliva.athome.lsd.ic.unicamp.br> <orvdnguzgf.fsf@free.oliva.athome.lsd.ic.unicamp.br> <4A25AECA.1010008@redhat.com>
On Jun 2, 2009, Richard Henderson <rth@redhat.com> wrote:
> Alexandre Oliva wrote:
>> + while (--ix)
>> + {
>> + prev = VEC_index (dw_attr_node, die->die_attr, ix - 1);
>> +
>> + if (prev->dw_attr == DW_AT_decl_line || prev->dw_attr == DW_AT_name)
>> + {
>> + VEC_replace (dw_attr_node, die->die_attr, ix, &linkage);
>> + return;
>> + }
>> + else
>> + VEC_replace (dw_attr_node, die->die_attr, ix, prev);
>> + }
> Mostly ok. But really I'd prefer to see this loop merely
> search, then use VEC_pop and VEC_quick_insert to move the
> entry.
Like this?
static inline void
move_linkage_attr (dw_die_ref die)
{
unsigned ix = VEC_length (dw_attr_node, die->die_attr);
dw_attr_node linkage = *VEC_index (dw_attr_node, die->die_attr, ix - 1);
gcc_assert (linkage.dw_attr == DW_AT_MIPS_linkage_name);
while (--ix > 0)
{
dw_attr_node *prev = VEC_index (dw_attr_node, die->die_attr, ix - 1);
if (prev->dw_attr == DW_AT_decl_line || prev->dw_attr == DW_AT_name)
break;
}
if (ix != VEC_length (dw_attr_node, die->die_attr) - 1)
{
VEC_pop (dw_attr_node, die->die_attr);
VEC_quick_insert (dw_attr_node, die->die_attr, ix, &linkage);
}
}
--
Alexandre Oliva, freedom fighter http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/ FSF Latin America board member
Free Software Evangelist Red Hat Brazil Compiler Engineer