From e8e9e1cda43a2b56618172896acb62103cd6bab8 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Tue, 26 Nov 2013 09:04:44 +0000 Subject: re PR tree-optimization/59287 (points-to analysis confused by union accesses) 2013-11-26 Richard Biener PR tree-optimization/59287 * tree-ssa-structalias.c (get_constraint_for_component_ref): Remove no longer necessary special-casing of union accesses. * gcc.dg/tree-ssa/alias-29.c: New testcase. From-SVN: r205380 --- gcc/tree-ssa-structalias.c | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'gcc/tree-ssa-structalias.c') diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index 2851eae..6482e68 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -3163,29 +3163,6 @@ get_constraint_for_component_ref (tree t, vec *results, return; } - /* Handle type-punning through unions. If we are extracting a pointer - from a union via a possibly type-punning access that pointer - points to anything, similar to a conversion of an integer to - a pointer. */ - if (!lhs_p) - { - tree u; - 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) - { - struct constraint_expr temp; - - temp.offset = 0; - temp.var = anything_id; - temp.type = ADDRESSOF; - results->safe_push (temp); - return; - } - } - t = get_ref_base_and_extent (t, &bitpos, &bitsize, &bitmaxsize); /* Pretend to take the address of the base, we'll take care of -- cgit v1.1