This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR14841 and PR15838
- From: Steven Bosscher <stevenb at suse dot de>
- To: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 31 Aug 2004 18:30:18 +0200
- Subject: Re: [PATCH] PR14841 and PR15838
- Organization: SUSE Labs
- References: <10408311628.AA07161@vlsi1.ultra.nyu.edu>
On Tuesday 31 August 2004 18:28, Richard Kenner wrote:
> * tree-ssa-ccp.c (try_extract_const_array_ref): New function to
> extract a constant from a constant array initializer.
> (try_extract_const_component_ref): Likewise for const struct
> initializers.
> (evaluate_stmt): Use them.
>
> We're duplicating a lot of code from fold-const.c.
Not really. This optimization is not done by fold-const.c.
Why else do you think it didn't work before? ;-)
We cannot do this in fold-const.c, because there we can't
tell if we had just "a = b[c];" or perhaps "a = &b[c];".
That's why I've put it in tree-ssa-ccp.c.
Gr.
Steven