This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: build_fold_addr_expr breaks verify_stmt
- From: "Richard Guenther" <richard dot guenther at gmail dot com>
- To: "Martin Schindewolf" <schindew at ira dot uka dot de>
- Cc: gcc at gcc dot gnu dot org, "Albert Cohen" <Albert dot Cohen at inria dot fr>
- Date: Thu, 7 Aug 2008 17:00:50 +0200
- Subject: Re: build_fold_addr_expr breaks verify_stmt
- References: <489B0CEF.70700@ira.uka.de>
On Thu, Aug 7, 2008 at 4:55 PM, Martin Schindewolf <schindew@ira.uka.de> wrote:
> Dear GCC-Developers,
>
> I am currently experiencing two problems (which seem related).
>
> (1) I wrote a pass that works after the gimplification is
> completed and amongst other things does the following:
> It passes the address of a variable to a function. To pass
> the address I use the build_fold_addr_expr which takes the
> address and seems to work quite well.
> The problem now occurs when the variable is used after the
> function call. Since the variable is used in a binary
> expression, the compiler complains about the following:
>
> error: invalid operand to binary operator
> m
> file.c: internal compiler error: verify_stmts failed
You need to replace all uses of the former(!) register variable
by a load into a register and a use of that new register. This
is because by taking the address of the variable you made
the variable no longer be a register.
In general doing what you do after gimplification is not a good idea.
Richard.