I am trying to compare the tree declarations of the lhs and the rhs of
the assignment statement in the following program.
struct node {
struct node * next;
};
struct node ** obj1, obj2;
obj1 = &obj2.next; // lhs is obj1, rhs is obj2.next
---
Let us call the following tree declaration of the lhs as "obj1_tree".
-
unsigned SI
size
unit size
align 32 symtab 0 alias set -1 canonical type 0x405cc000
pointer_to_this >
unsigned SI
size
unit size
align 32 symtab 0 alias set -1 canonical type 0x405c5ea0>
used unsigned SI file structstruct2.c line 8 col 17
size constant 32>
unit size constant 4>
align 32 context chain >
-
Let us call the following tree declaration of the rhs as
"obj2.next_tree"
-
unit size
align 32 symtab 0 alias set -1 canonical type 0x405c5f60
fields context
pointer_to_this chain >
unsigned SI
size
unit size
align 32 symtab 0 alias set -1 canonical type 0x405cc000
pointer_to_this >
used unsigned nonlocal SI file structstruct2.c line 3 col 16
size constant 32>
unit size constant 4>
align 32 offset_align 128
offset constant 0>
bit offset constant 0> context chain
>
-
Please note from the above tree declarations that
Type1 = TREE_TYPE (TREE_TYPE (obj1_tree)) = 0x405c5f00
Type2 = TREE_TYPE (obj2.next_tree) = 0x405cc000
Type3 = TYPE_POINTER_TO (TREE_TYPE (TREE_TYPE (obj2.next_tree))) =
0x405c5f00
I was expecting Type1 and Type2 to be equal because obj1=&obj2.next.
However, in this case, we see that Type1 and Type3 are equal. Please
explain this.
Also, what is the meaning of "pointer_to_this" in the tree declarations?
Thanks and regards,
Vini Kanvar.