Skip to content
This repository has been archived by the owner on Jun 20, 2019. It is now read-only.

Commit

Permalink
Update alias set language hook to return unhandled.
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuclaw committed Jan 23, 2018
1 parent 4cbd9ca commit 58f255f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
5 changes: 5 additions & 0 deletions gcc/d/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2018-01-23 Iain Buclaw <[email protected]>

* d-lang.cc (d_get_alias_set): Use alias set of pointer type for
dynamic arrays. Return unhandled for all other cases.

2018-01-08 Eugene Wissner <[email protected]>

* d-builtins.cc (d_eval_constant_expression): Handle polynomial
Expand Down
19 changes: 4 additions & 15 deletions gcc/d/d-lang.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1475,22 +1475,11 @@ d_getdecls (void)
static alias_set_type
d_get_alias_set (tree t)
{
/* Permit type-punning when accessing a union, provided the access
is directly through the union. */
for (tree u = t; handled_component_p (u); u = TREE_OPERAND (u, 0))
{
if (TREE_CODE (u) == COMPONENT_REF
&& TREE_CODE (TREE_TYPE (TREE_OPERAND (u, 0))) == UNION_TYPE)
return 0;
}
/* For dynamic arrays, use the same alias type as .ptr type. */
if (TREE_CODE (t) == RECORD_TYPE && TYPE_DYNAMIC_ARRAY (t))
return get_alias_set (TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (t))));

/* That's all the expressions we handle. */
if (!TYPE_P (t))
return get_alias_set (TREE_TYPE (t));

/* For now in D, assume everything aliases everything else,
until we define some solid rules. */
return 0;
return -1;
}

/* Implements the lang_hooks.types_compatible_p routine for language D.
Expand Down

0 comments on commit 58f255f

Please sign in to comment.