"invalid operand to binary operator" problem

Ferenc Kovacs feri1024@freemail.hu
Tue Aug 30 11:34:00 GMT 2005


Hello!

I'm implementing a new IPA phase in GCC-4.1. I need to pass the address
of a variable found in the stmt list to a newly created function (eg.
"f") like this:

{
  int x; /* ordinary non-pointertype local vars */
  int y;

  [...]

  x = 5;
  y = x + 9;
  f (&x); /* new call stmt inserted to the stmt list */

  [...]
}

I used the build_addr function to build the address of that variable
used in the parameter list of the new function "f" and bsi_insert_... to
insert the call. Anyway, I don't really know doing things like these are
possible when we're still in the IPA stage... ^^ So, I got these error
messages:

[...]
/home/feri/tmp/hello.c:118: error: invalid operand to binary operator
x

/home/feri/tmp/hello.c:118: internal compiler error: verify_stmts failed
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
[...]

is_gimple_val returns false to the variable "x", becouse
needs_to_live_in_memory (the build_addr sets the TREE_ADDRESSABLE flag)
gives true to is_gimple_reg and this way is_gimple_reg returns false. I
tried to manually set the TREE_ADDRESSABLE flag of "x" and not to insert
any stmt containing the address of "x", but without "&x" I didn't get
this error. It seems, that "x" is not a valid gimple rvalue. How can I
make "x" a real gimple rvalue again?

Thanks, in advance.

Regards,
  Feri

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20050830/565d6e26/attachment.sig>


More information about the Gcc mailing list