This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] tree-ssa vs. fold
- From: Zack Weinberg <zack at codesourcery dot com>
- To: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- Cc: rth at redhat dot com, gcc at gcc dot gnu dot org
- Date: Sun, 08 Jun 2003 11:15:28 -0700
- Subject: Re: [tree-ssa] tree-ssa vs. fold
- References: <10306081353.AA10481@vlsi1.ultra.nyu.edu>
kenner@vlsi1.ultra.nyu.edu (Richard Kenner) writes:
> Hum, perhaps. However, it does seem like we ought be
> be able to do *something* in the extremely common case of
> a plain "int" variable.
>
> No, it's the "plain 'int' variable" that is the source of the problem!
>
> Consider:
>
> void
> sub1 (int n)
> {
> int arr[n];
>
> n = 10;
>
> .... sizeof (arr) ...
>
> You want the sizeof to use the value of N on entry, so you need the
> SAVE_EXPR.
Wouldn't this get rewritten immediately as
void
sub1 (int n.1)
{
int arr[n.1];
n.2 = 10;
... sizeof (arr) ...
as part of the conversion to SSA form?
zw