On 11/02/2011 12:28 PM, Richard Henderson wrote:
On 11/02/2011 07:59 AM, Andrew MacLeod wrote:
+ /* Parameters at this point are usually cast to void *, so check for
that
+ and look past the cast. */
+ if (TREE_CODE (arg1) == NOP_EXPR&& POINTER_TYPE_P (ttype)
+ && VOID_TYPE_P (TREE_TYPE (ttype)))
+ arg1 = TREE_OPERAND (arg1, 0);
+
+ ttype = TREE_TYPE (arg1);
+ gcc_assert (POINTER_TYPE_P (ttype));
+
+ /* Get the underlying type of the object. */
+ ttype = TREE_TYPE (ttype);
+ type_align = TYPE_ALIGN (ttype);
I take that back. Does this really work? It certainly doesn't seem like
it would work in SSA mode. You'd need to look back to the def.
it did in my simply trials as I figured this out in the debugger :-)
i only did basic tests. OK, Is there a simple way to get to the def?
what happens to the alignment of something if its say 'char *' type and
its cast to an (int *) oir something with more strict alignment... or
will the compiler complain about that?
Andrew