This is the mail archive of the
mailing list for the GCC project.
Re: double gimplification in C++ FE
- From: Jason Merrill <jason at redhat dot com>
- To: Aldy Hernandez <aldyh at redhat dot com>
- Cc: dnovillo at google dot com, gcc at gcc dot gnu dot org
- Date: Tue, 16 Oct 2007 11:59:13 -0400
- Subject: Re: double gimplification in C++ FE
- References: <20071016150015.GA19007@redhat.com>
Aldy Hernandez wrote:
I'm in the process of converting the C++ FE to tuples. In doing so I
have noticed that the C++ FE will frequently gimplify bits of a tree,
and then expect gimplify_expr() to gimplify the rest. This seems
redundant, as gimplify_expr() more often than not will gimplify the
entire tree structure, without regard to what parts the C++ FE already
Yes, the gimplifier often makes several passes over the same trees to
get them completely lowered. cp_gimplify_expr is a subroutine of the
This behavior is common throughout C++. The C++ FE calls gimplify_stmt
on bits of trees, but then gimplify_expr() has to gimplify again.
It seems to me that a better approach would be to pass the
tree structure as generic as we can (without calls to gimplify_stmt in
the C++ FE), and then let gimplify_expr do its job.
Sure. Another alternative would be to leave the calls to gimplify_stmt
(or probably change them to gimplify_to_stmt_list) and return
GS_ALL_DONE from cp_gimplify_expr.