From 4aa83879c93d2367f5245c94bd2f12c19f486dae Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Wed, 29 Jun 2016 07:30:31 +0000 Subject: re PR middle-end/71002 (-fstrict-aliasing breaks Boost's short string optimization implementation) 2016-06-29 Richard Biener 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. From-SVN: r237839 --- gcc/gimple.c | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'gcc/gimple.c') diff --git a/gcc/gimple.c b/gcc/gimple.c index 677c560..e275dfc 100644 --- a/gcc/gimple.c +++ b/gcc/gimple.c @@ -2400,21 +2400,6 @@ gimple_signed_type (tree type) alias_set_type gimple_get_alias_set (tree t) { - tree u; - - /* 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; -- cgit v1.1