This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [ast-optimizer-branch]: SAVE_EXPR's not simplified right
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Zack Weinberg <zack at codesourcery dot com>, Daniel Berlin <dberlin at dberlin dot org>
- Cc: Diego Novillo <dnovillo at redhat dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 06 May 2002 16:02:18 -0700
- Subject: Re: [ast-optimizer-branch]: SAVE_EXPR's not simplified right
- References: <20020506153157.GC2542@codesourcery.com>
--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