diff options
author | Osku Salerma <osku@iki.fi> | 2002-05-31 00:28:17 +0300 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2002-05-30 14:28:17 -0700 |
commit | d18b1ed89ece9698c8e3d0a90534bbf9fe103951 (patch) | |
tree | ee747f8a73267f90560111b8582704eea377e81c /gcc/c-common.c | |
parent | a7943381121420155a686f4d9a086acef1c95548 (diff) | |
download | gcc-d18b1ed89ece9698c8e3d0a90534bbf9fe103951.zip gcc-d18b1ed89ece9698c8e3d0a90534bbf9fe103951.tar.gz gcc-d18b1ed89ece9698c8e3d0a90534bbf9fe103951.tar.bz2 |
c-common.c (c_common_attribute_table): Add "may_alias" entry.
* c-common.c (c_common_attribute_table): Add "may_alias" entry.
(c_common_get_alias_set): Handle it.
* doc/extend.texi: Document it.
* gcc.c-torture/execute/mayalias-1.c: New file.
From-SVN: r54074
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r-- | gcc/c-common.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c index b1a9205..8a554e8 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -430,6 +430,7 @@ const struct attribute_spec c_common_attribute_table[] = handle_nonnull_attribute }, { "nothrow", 0, 0, true, false, false, handle_nothrow_attribute }, + { "may_alias", 0, 0, false, true, false, NULL }, { NULL, 0, 0, false, false, false, NULL } }; @@ -2551,6 +2552,10 @@ c_common_get_alias_set (t) && TYPE_PRECISION (TREE_TYPE (t)) == TYPE_PRECISION (char_type_node)) return 0; + /* If it has the may_alias attribute, it can alias anything. */ + if (TYPE_P (t) && lookup_attribute ("may_alias", TYPE_ATTRIBUTES (t))) + return 0; + /* That's all the expressions we handle specially. */ if (! TYPE_P (t)) return -1; |