Daniel Berlin wrote:
On Sun, 2005-08-28 at 23:14 -0700, Mark Mitchell wrote:
In other words, does your patch result in better code?
No, not at the moment.
Given that, I think we should see if we can get this ready to be checked
in immediately after 4.1 branches.
On the technical side, my most basic question is about the
representation you chose. Why did you choose to have the first operand
be a POINTER_TYPE rather than an ARRAY_TYPE?
Because that is what the user wrote, and all my attempts to transform
the POINTER_TYPE into an ARRAY_TYPE acceptable by the middle end failed
miserably.
:)
I think a better tree
representation would be to use the tree equivalent of:
*((T (*)[]) p)
Honestly, I have no idea how to do this.
I would think something like this, assuming that the user has a pointer
expression "p":
elt_type = TREE_TYPE (p);
array_type = build_array_type (elt_type, /*index_type=*/NULL_TREE);
pointer_type = build_pointer_type (array_type);
p = build1 (NOP_EXPR, pointer_type, p);
p = build1 (INDIRECT_REF, array_type, p);