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

Update alias set language hook to return unhandled. #598

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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