diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2007-02-19 19:11:37 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2007-02-19 19:11:37 +0000 |
commit | df10ee2a5a023ec7f9edf5961bec74b4aa475780 (patch) | |
tree | aa25bc1935ed24eb30636d7e63fddb62f545bd69 /gcc/gimplify.c | |
parent | 9f8c673960975867c320f03a153f448568408f9a (diff) | |
download | gcc-df10ee2a5a023ec7f9edf5961bec74b4aa475780.zip gcc-df10ee2a5a023ec7f9edf5961bec74b4aa475780.tar.gz gcc-df10ee2a5a023ec7f9edf5961bec74b4aa475780.tar.bz2 |
gimplify.c (gimplify_init_ctor_preeval_1): Detect potential overlap due to calls to functions taking pointers as parameters.
* gimplify.c (gimplify_init_ctor_preeval_1): Detect potential overlap
due to calls to functions taking pointers as parameters.
From-SVN: r122133
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r-- | gcc/gimplify.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 34e6249..02eed6a 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -2628,6 +2628,21 @@ gimplify_init_ctor_preeval_1 (tree *tp, int *walk_subtrees, void *xdata) && alias_sets_conflict_p (data->lhs_alias_set, get_alias_set (t))) return t; + /* If the constructor component is a call, determine if it can hide a + potential overlap with the lhs through an INDIRECT_REF like above. */ + if (TREE_CODE (t) == CALL_EXPR) + { + tree type, fntype = TREE_TYPE (TREE_TYPE (CALL_EXPR_FN (t))); + + for (type = TYPE_ARG_TYPES (fntype); type; type = TREE_CHAIN (type)) + if (POINTER_TYPE_P (TREE_VALUE (type)) + && (!data->lhs_base_decl || TREE_ADDRESSABLE (data->lhs_base_decl)) + && alias_sets_conflict_p (data->lhs_alias_set, + get_alias_set + (TREE_TYPE (TREE_VALUE (type))))) + return t; + } + if (IS_TYPE_OR_DECL_P (t)) *walk_subtrees = 0; return NULL; |