This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Problem with operand handling
- From: Andrew MacLeod <amacleod at redhat dot com>
- To: Richard Kenner <kenner at vlsi1 dot ultra dot nyu dot edu>
- Cc: gcc mailing list <gcc at gcc dot gnu dot org>
- Date: Tue, 07 Sep 2004 08:20:06 -0400
- Subject: Re: Problem with operand handling
- References: <10409041451.AA09485@vlsi1.ultra.nyu.edu>
On Sat, 2004-09-04 at 10:51, Richard Kenner wrote:
> When I work around the problem with lcm.c, I then get:
>
> ../../xgcc -B../../ -c -g -O2 -W -Wall -gnatpg g-exctra.adb -o g-exctra.o
> +===========================GNAT BUG DETECTED==============================+
> | 5.03h (20040831) (x86_64-unknown-linux-gnu) GCC error: |
> | in var_ann, at tree-flow-inline.h:38 |
>
> Upon investigating, I find I don't understand something about tree-ssa-operands.
>
> It looks like add_stmt_operand is supposed to be passed a pointer to the
> operand. But in a number of places in tree-ssa-operands.c, you have
>
> tree var = referenced_var (i);
>
> add_stmt_operand (&var, ...);
>
> But this puts a pointer into the stack of that function into the operands
> of the statement. That looks very wrong and seems to be causing my problem.
> How is that supposed to work?
Well, I didnt actually write that part of the code, I think thats
Diego's :-)
The only time &var is used as a pointer is if the variable passes the
test 'is_gimple_reg()'. Only real operands store this pointer value.
If var is a virtual SSA_NAME operand, then we store *var into a tree and
keep that value around.
So this should only be causing you a problem if you have an
is_gimple_reg() which is being passed to add_stmt_operand in this
manner. The thats a bug.
Andrew