>   if (TREE_CODE (arg) == ADDR_EXPR)
>     {
>+      tree argtype = TREE_TYPE (arg);
>+      chartype = argtype;

This assignment should be unnecessary here.  Right?

>+
>       arg = TREE_OPERAND (arg, 0);
>       tree ref = arg;
>       if (TREE_CODE (arg) == ARRAY_REF)
>       {
>         tree idx = TREE_OPERAND (arg, 1);
>-        if (TREE_CODE (idx) != INTEGER_CST)
>+        if (TREE_CODE (idx) != INTEGER_CST
>+            && TREE_CODE (argtype) == POINTER_TYPE)

What else could the type of an ADDR_EXPR be?
argtype is TREE_TYPE(arg).
Do you have a test case where TREE_CODE(argtype) is not POINTER_TYPE?


Bernd.

Reply via email to