This is the mail archive of the gcc@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: 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


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