This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: ICE in change_address at emit_rtl.c
- From: Per Bothner <per at bothner dot com>
- To: Richard Kenner <kenner at vlsi1 dot ultra dot nyu dot edu>
- Cc: gcc at gcc dot gnu dot org
- Date: Sun, 25 Nov 2001 14:32:03 -0800
- Subject: Re: ICE in change_address at emit_rtl.c
- References: <10111252138.AA28465@vlsi1.ultra.nyu.edu>
Richard Kenner wrote:
> This is one reason why fold causes problems as it sometimes
> creates SAVE_EXPR. Using a scoped temporary:
> let tmp := expr in BODY
> would be preferable for us.
>
>But is it realistic for fold to make one? fold has no idea where the
>expression being folded is going.
>
I'm not sure what the problem is. My proposal is to use some kind of
LET_EXPR, which takes a declaration and two expressions. It seems
plausible to me that any place that creates a SAVE_EXPR could use a
LET_EXPR instead. For example:
arr[index] += expr
Here of course arr and index should only be evaluated once. So this
would be
LET t1 :=arr IN LET t2 := index IN t1[t2] = t1[t2] + expr
Similarly, where fold creates a SAVE_EXPR because some sub-expression
may be evaluated more than once, you can wrap the expression (the argument
to fold) in a LET_EXPR, or whatever makes sense. I.e. you can control
the lifetime of the temporary as it is needed.
--Per Bothner