summaryrefslogtreecommitdiff
path: root/gcc/c-family/c-common.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2016-06-29 07:30:31 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2016-06-29 07:30:31 +0000
commitb6a4a0f583f239aae2fb37dba76b48a28b238476 (patch)
tree29eb8891c24a3daecbf68e50445cf77606b498d4 /gcc/c-family/c-common.c
parentf2bfcc6070770b77b1dc7b68aead8ea66ff2e107 (diff)
downloadgcc-b6a4a0f583f239aae2fb37dba76b48a28b238476.tar.gz
2016-06-29 Richard Biener <rguenther@suse.de>
PR middle-end/71002 * alias.c (component_uses_parent_alias_set_from): Handle type punning through union accesses by using the union alias set. * gimple.c (gimple_get_alias_set): Remove union type punning case. c-family/ * c-common.c (c_common_get_alias_set): Remove union type punning case. fortran/ * f95-lang.c (LANG_HOOKS_GET_ALIAS_SET): Remove (un-)define. (gfc_get_alias_set): Remove. * g++.dg/torture/pr71002.C: Adjust testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@237839 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-family/c-common.c')
-rw-r--r--gcc/c-family/c-common.c15
1 files changed, 0 insertions, 15 deletions
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index 3301c313998..936ddfb87e5 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -4736,8 +4736,6 @@ static GTY(()) hash_table<c_type_hasher> *type_hash_table;
alias_set_type
c_common_get_alias_set (tree t)
{
- tree u;
-
/* For VLAs, use the alias set of the element type rather than the
default of alias set 0 for types compared structurally. */
if (TYPE_P (t) && TYPE_STRUCTURAL_EQUALITY_P (t))
@@ -4747,19 +4745,6 @@ c_common_get_alias_set (tree t)
return -1;
}
- /* Permit type-punning when accessing a union, provided the access
- is directly through the union. For example, this code does not
- permit taking the address of a union member and then storing
- through it. Even the type-punning allowed here is a GCC
- extension, albeit a common and useful one; the C standard says
- that such accesses have implementation-defined behavior. */
- for (u = t;
- TREE_CODE (u) == COMPONENT_REF || TREE_CODE (u) == ARRAY_REF;
- u = TREE_OPERAND (u, 0))
- if (TREE_CODE (u) == COMPONENT_REF
- && TREE_CODE (TREE_TYPE (TREE_OPERAND (u, 0))) == UNION_TYPE)
- return 0;
-
/* That's all the expressions we handle specially. */
if (!TYPE_P (t))
return -1;