This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Language-independent functions-as-trees representation
- From: Daniel Berlin <dberlin at dberlin dot org>
- To: Jason Merrill <jason at redhat dot com>
- Cc: Mark Mitchell <mark at codesourcery dot com>,Richard Henderson <rth at redhat dot com>, Per Bothner <per at bothner dot com>,Diego Novillo <dnovillo at redhat dot com>,"gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Mon, 22 Jul 2002 02:20:36 -0400 (EDT)
- Subject: Re: Language-independent functions-as-trees representation
On Sun, 21 Jul 2002, Jason Merrill wrote:
> >>>>> "Mark" == Mark Mitchell <mark@codesourcery.com> writes:
>
> > My disagreement with Per is closer to the front end; I would really
> > like the internal representation produced from C++ semantic analysis
> > to look like C++ -- with various implicit things made explict (like
> > default arguments, choice of overloaded function, choice of template
> > specialization, action to take on cleanup of object, etc.)
>
> I don't have a problem with this, except that it makes lowering more
> complicated.
>
> > In SIMPLE, one place where I would like the statement/expression to come
> > in to play is the following:
>
> > If two expressions are "the same", i.e., both are "x + y", then they
> > are actually the same pointer.
>
> Why? We don't currently share expressions in RTL; why would we want to do
> so in SIMPLE?
>
> The current simplification code explicitly unshares all the trees to avoid
> SAVE_EXPR-like problems with shared expressions.
Not all of them. Or at least, if it should, it's buggy.
>From a SSAPRE dump:
In BB 111, insert save of la - lb to pretmp.4753 in statement T.4530 = la
- lb on line 2047
In BB 135, insert reload of la - lb from pretmp.4753 in statement T.4676 =
la - lb on line 2091
In BB 136, insert reload of la - lb from pretmp.4753 in statement T.4530 =
pretmp.4753 = la - lb on line 2047
The last one occurs because, once simplified, we have:
for (T.4530 = la - lb; j <= T.4530; T.4530 = la - lb)
{
Where the T.4530 = la - lb 's are shared.
--Dan