This repository was archived by the owner on Jun 20, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-15
lines changed Expand file tree Collapse file tree 2 files changed +9
-15
lines changed Original file line number Diff line number Diff line change 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+
162018-01-08 Eugene Wissner <
[email protected] >
27
38 * d-builtins.cc (d_eval_constant_expression): Handle polynomial
Original file line number Diff line number Diff line change @@ -1475,22 +1475,11 @@ d_getdecls (void)
14751475static alias_set_type
14761476d_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.
You can’t perform that action at this time.
0 commit comments