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: [ast-optimizer-branch]: SAVE_EXPR's not simplified right




--On Monday, May 06, 2002 08:31:57 AM -0700 Zack Weinberg 
<zack@codesourcery.com> wrote:

> On Mon, May 06, 2002 at 10:12:59AM -0400, Daniel Berlin wrote:
>> >
>> > If we disable save_expr simplification, we get this one right
>> > but we still create unnecessary expression copies.
>> >
>>
>> I also tried only simplifying what's *in* the save_expr, but it doesn't
>> completely fix it.
>>
>> It *does* fix a lot of cases however, so it might be workable.
>>
>> The cases it doesn't handle right are those where we have a
>> self-modifying expression multiple times in the same stmt.
> ...
>
> Maybe it's time to get rid of SAVE_EXPR altogether?  Per Bothner had a
> pretty detailed proposal for what to replace it with -- search the
> mailing lists for LET_EXPR.

That would be good.  I'd go even further; just create explicitly create
temporaries in DECL_STMTs and use them.  It's not hard to keep track
of the most recently opened scope so that you know where to put such
statements.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com


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