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

I assume that the error occurs because one of the GIMPLE
assumptions (that every global variable is assigned to
a local one) is violated. This happens because the call to
build_fold_addr_expr takes the address of the variable and
the variable escapes the local scope. Are there any means
to work around this issue?

(2) I would like to capture the value of a variable in a
temporary and restore it under certain conditions. Adding
the temporaries and inserting the assignments both ways
(to save and restore the values) works fine.
Unfortunately, none of the temporary variables
survives the SSA optimisations. Is there something (maybe
similar to the VDEF for memory locations) that prevents
optimisation of variables? (I tried to set VDEFs on the
variables directly but this breaks the SSA properties).

Thank you very much for your suggestions!

Regards,
Martin

Reply via email to