This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
ADDR_EXPR in gimple
- From: k9119911 <xxx-protoss at yahoo dot com dot tw>
- To: gcc-help at gcc dot gnu dot org
- Date: Wed, 2 Sep 2015 21:38:30 -0700 (MST)
- Subject: ADDR_EXPR in gimple
- Authentication-results: sourceware.org; auth=none
Hi
I need to do some instrumentations in gimple for some operations like a = b
+ c
For such operation, I want to get the address of a, b, and c and call a
function to handle it.
However, I have some problems to do it.
The following is my instrumentation:
gimple_assign <plus_expr, a, b, c>
gimple_assign <addr_expr, op0_addr.0, &a, NULL>
gimple_assign <addr_expr, op1_addr.1, &b, NULL>
gimple_assign <addr_expr, op2_addr.2, &c, NULL>
gimple_call <foo, NULL, a, b, c, op0_addr.0, op1_addr.1, op2_addr.2>
Because I really need to get the address of those operands, I need to set
those operands addressable(i.e. TREE_ADDRESSABLE(a) = 1). Then
I use build1(ADDR_EXPR, ptr_type_node, a) to get the address.
And op0_addr.0, op1_addr.1, and op2_addr.2 are all void * type.
However, I got wired gcc_assert(0) in propagate_necessity, at
tree-ssa-dce.c:978.
If I don't set it, I need to gimplify the addr_expr before assignment.
However, the result is not what I wnat because gimplify will create an
intermediate
variable and I got the address of the intermediate variable instead of the
original one.
I use gcc-4.7.2.
This is a weird problem.
Please help me, thanks.
I use gcc-4.7.2.
--
View this message in context: http://gcc.1065356.n5.nabble.com/ADDR-EXPR-in-gimple-tp1182283.html
Sent from the gcc - Help mailing list archive at Nabble.com.