if (t == 0 || t == error_mark_node || ! POINTER_TYPE_P (TREE_TYPE (t)))
return 0;
- /* If this is a declaration, return it. */
+ /* If this is a declaration, return it. If T is based on a restrict
+ qualified decl, return that decl. */
if (DECL_P (t))
- return t;
+ {
+ if (TREE_CODE (t) == VAR_DECL && DECL_BASED_ON_RESTRICT_P (t))
+ t = DECL_GET_RESTRICT_BASE (t);
+ return t;
+ }
/* Handle general expressions. It would be nice to deal with
COMPONENT_REFs here. If we could tell that `a' and `b' were the
do
{
fieldx = TREE_OPERAND (x, 1);
- typex = DECL_FIELD_CONTEXT (fieldx);
+ typex = TYPE_MAIN_VARIANT (DECL_FIELD_CONTEXT (fieldx));
y = orig_y;
do
{
fieldy = TREE_OPERAND (y, 1);
- typey = DECL_FIELD_CONTEXT (fieldy);
+ typey = TYPE_MAIN_VARIANT (DECL_FIELD_CONTEXT (fieldy));
if (typex == typey)
goto found;
}
while (x && TREE_CODE (x) == COMPONENT_REF);
/* Never found a common type. */
- return true;
+ return false;
found:
/* If we're left with accessing different fields of a structure,