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

Commit 58f255f

Browse files
committed
Update alias set language hook to return unhandled.
1 parent 4cbd9ca commit 58f255f

File tree

2 files changed

+9
-15
lines changed

2 files changed

+9
-15
lines changed

gcc/d/ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2018-01-23 Iain Buclaw <[email protected]>
2+
3+
* d-lang.cc (d_get_alias_set): Use alias set of pointer type for
4+
dynamic arrays. Return unhandled for all other cases.
5+
16
2018-01-08 Eugene Wissner <[email protected]>
27

38
* d-builtins.cc (d_eval_constant_expression): Handle polynomial

gcc/d/d-lang.cc

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1475,22 +1475,11 @@ d_getdecls (void)
14751475
static alias_set_type
14761476
d_get_alias_set (tree t)
14771477
{
1478-
/* Permit type-punning when accessing a union, provided the access
1479-
is directly through the union. */
1480-
for (tree u = t; handled_component_p (u); u = TREE_OPERAND (u, 0))
1481-
{
1482-
if (TREE_CODE (u) == COMPONENT_REF
1483-
&& TREE_CODE (TREE_TYPE (TREE_OPERAND (u, 0))) == UNION_TYPE)
1484-
return 0;
1485-
}
1478+
/* For dynamic arrays, use the same alias type as .ptr type. */
1479+
if (TREE_CODE (t) == RECORD_TYPE && TYPE_DYNAMIC_ARRAY (t))
1480+
return get_alias_set (TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (t))));
14861481

1487-
/* That's all the expressions we handle. */
1488-
if (!TYPE_P (t))
1489-
return get_alias_set (TREE_TYPE (t));
1490-
1491-
/* For now in D, assume everything aliases everything else,
1492-
until we define some solid rules. */
1493-
return 0;
1482+
return -1;
14941483
}
14951484

14961485
/* Implements the lang_hooks.types_compatible_p routine for language D.

0 commit comments

Comments
 (0)