This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: patch that caused regression PR c/8730
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- To: janis187 at us dot ibm dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 24 Dec 02 19:22:15 EST
- Subject: Re: patch that caused regression PR c/8730
The regression reported in PR c/8730 showed up starting
with this large patch from long, long ago:
Sat Nov 27 08:38:26 1999 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* fold-const.c (negate_expr, associate_trees, extract_muldiv): New.
void foo() {
void *bar (int i, int A[1][i]) { return A[0]; };
};
I looked at this and am quite confused how this is supposed to work with the
new function-at-a-time processing. I don't understand how the above patch
related to this, though.
What's happening is that a SAVE_EXPR is being made to compute the size of
the inner array. Its SAVE_EXPR_CONTEXT is foo, not bar, but when it's
evaluated for the first time in bar, it blows up.
It's true that SAVE_EXPR is made in extract_muldiv, but it's made from a
SAVE_EXPR that has the save SAVE_EXPR_CONTEXT.
I believe that these SAVE_EXPRs should have SAVE_EXPR_CONTEXT of bar, the
inner function.
Somebody who understand the C front end's function-at-a-time handling should
look at this.