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][C++] Fix PR40834: [4.5 Regression] Revision 149750 failed 483.xalancbmk in SPEC CPU 2006


On Wed, Jul 29, 2009 at 11:38 AM, Richard
Guenther<richard.guenther@gmail.com> wrote:
> On Wed, Jul 29, 2009 at 8:30 PM, Jason Merrill<jason@redhat.com> wrote:
>> On 07/29/2009 02:28 PM, Richard Guenther wrote:
>>>
>>> On Wed, 29 Jul 2009, Jason Merrill wrote:
>>
>>>> It seems to me that pushing and popping around walking the body is good
>>>> enough; I don't think we can get a USING_STMT inside a DECL_INITIAL
>>>> without
>>>> another BIND_EXPR along the way.
>>
>>> But that is what I do ... or what do you have in mind?
>>
>> That's what the current code does, yes. ?The patch changes it to walk the
>> BIND_EXPR itself twice, which I would prefer to avoid.
>>
>>> Note that the
>>>
>>> present issue has nothing to do with USING_STMTs but with re-writing
>>> DECL_BY_REFERENCE variables in initializers (thus BIND_EXPR_VARs).
>>
>> Right, we need to walk BIND_EXPR_VARS once, whereas the old code walks it
>> zero times. ?Leaving *walk_subtrees alone should mean that we walk it once.
>
> I see. ?The following seems to work, ok if it passes bootstrap / regtest?
>
> Thanks,
> Richard.
>
> Index: cp/cp-gimplify.c
> ===================================================================
> --- cp/cp-gimplify.c ? ?(revision 150100)
> +++ cp/cp-gimplify.c ? ?(working copy)
> @@ -810,7 +810,6 @@ cp_genericize_r (tree *stmt_p, int *walk
> ? ? ? cp_walk_tree (&BIND_EXPR_BODY (stmt),
> ? ? ? ? ? ? ? ? ? ?cp_genericize_r, data, NULL);
> ? ? ? VEC_pop (tree, wtd->bind_expr_stack);
> - ? ? ?*walk_subtrees = 0;
> ? ? }
>
> ? else if (TREE_CODE (stmt) == USING_STMT)
>

It fixes 483.xalancbmk.

Thanks.

-- 
H.J.


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