aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-alias-warnings.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2008-06-12 10:21:45 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2008-06-12 10:21:45 +0000
commitb377855627f22cdef5712621e89e68048a94a164 (patch)
treee7f6dd778d69424ba44e89344260ba54c29fac8c /gcc/tree-ssa-alias-warnings.c
parent3fd29fa912911b3db52046ef0d44144dd0e043ee (diff)
downloadgcc-b377855627f22cdef5712621e89e68048a94a164.zip
gcc-b377855627f22cdef5712621e89e68048a94a164.tar.gz
gcc-b377855627f22cdef5712621e89e68048a94a164.tar.bz2
re PR tree-optimization/36345 (TBAA-pruning of points-to sets ineffective)
2008-06-12 Richard Guenther <rguenther@suse.de> PR tree-optimization/36345 * tree-flow.h (struct ptr_info_def): Align escape_mask, add memory_tag_needed flag. (may_alias_p): Declare. * tree-ssa-alias.c (may_alias_p): Export. (set_initial_properties): Use memory_tag_needed flag. (update_reference_counts): Likewise. (reset_alias_info): Reset memory_tag_needed flag. (create_name_tags): Check memory_tag_needed flag. (dump_points_to_info_for): Dump it. * tree-ssa-structalias.c (struct variable_info): Remove directly_dereferenced flag. (new_var_info): Do not initialize it. (process_constraint_1): Do not set it. (update_alias_info): Set is_dereferenced flag. (set_uids_in_ptset): Use may_alias_p. (set_used_smts): Check memory_tag_needed flag. (find_what_p_points_to): Likewise. Pass is_dereferenced flag. * tree-ssa-alias.c (verify_flow_sensitive_alias_info): Check memory_tag_needed flag. * tree-ssa-alias-warnings.c (dsa_named_for): Try to recover from broken design. * gcc.c-torture/execute/20020619-1.c: Remove broken part of the testcase. From-SVN: r136695
Diffstat (limited to 'gcc/tree-ssa-alias-warnings.c')
-rw-r--r--gcc/tree-ssa-alias-warnings.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/tree-ssa-alias-warnings.c b/gcc/tree-ssa-alias-warnings.c
index bf95258..be26cb3 100644
--- a/gcc/tree-ssa-alias-warnings.c
+++ b/gcc/tree-ssa-alias-warnings.c
@@ -914,6 +914,7 @@ dsa_named_for (tree ptr)
{
unsigned ix;
bitmap_iterator bi;
+ bool any = false;
EXECUTE_IF_SET_IN_BITMAP (pi->pt_vars, 0, ix, bi)
{
@@ -922,7 +923,16 @@ dsa_named_for (tree ptr)
if (nonstandard_alias_p (ptr, alias, false))
strict_aliasing_warn (SSA_NAME_DEF_STMT (ptr),
ptr, true, alias, false, true);
+ else
+ any = true;
}
+
+ /* If there was no object in the points-to set that the pointer
+ may alias, unconditionally warn. */
+ if (!any)
+ warning (OPT_Wstrict_aliasing,
+ "dereferencing type-punned pointer %D will "
+ "break strict-aliasing rules", SSA_NAME_VAR (ptr));
}
}
}