diff options
author | James E Wilson <wilson@specifixinc.com> | 2004-03-10 06:02:55 +0000 |
---|---|---|
committer | Jim Wilson <wilson@gcc.gnu.org> | 2004-03-09 22:02:55 -0800 |
commit | 5399d643680b153db318cd9ef38787774eac34c4 (patch) | |
tree | 893bd1037263eb2e8912cc841d795b6695e442e7 /gcc/alias.c | |
parent | a4e9467d735cfdbcbe64902f9a3dd30c440c71fb (diff) | |
download | gcc-5399d643680b153db318cd9ef38787774eac34c4.zip gcc-5399d643680b153db318cd9ef38787774eac34c4.tar.gz gcc-5399d643680b153db318cd9ef38787774eac34c4.tar.bz2 |
New option -Wstrict-aliasing=2.
* alias.c (alias_sets_might_conflict_p): New.
* c-typeck.c (build_c_cast): Call it if warn_strict_aliasing > 1.
* common.opt (Wstrict-aliasing=): New.
* flags.h (warn_strict_aliasing): Change type to int.
* opts.c (warn_strict_aliasing): Change type to int.
(common_handle_option): Handle OPT_Wstrict_aliasing_.
* tree.h (alias_sets_might_conflict_p): Declare it.
* doc/invoke.tex (-Wstrict-aliasing=2): Document it.
From-SVN: r79222
Diffstat (limited to 'gcc/alias.c')
-rw-r--r-- | gcc/alias.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/alias.c b/gcc/alias.c index d670a7d..30013ec 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -290,6 +290,19 @@ alias_sets_conflict_p (HOST_WIDE_INT set1, HOST_WIDE_INT set2) child of the other. Therefore, they cannot alias. */ return 0; } + +/* Return 1 if the two specified alias sets might conflict, or if any subtype + of these alias sets might conflict. */ + +int +alias_sets_might_conflict_p (HOST_WIDE_INT set1, HOST_WIDE_INT set2) +{ + if (set1 == 0 || set2 == 0 || set1 == set2) + return 1; + + return 0; +} + /* Return 1 if TYPE is a RECORD_TYPE, UNION_TYPE, or QUAL_UNION_TYPE and has has any readonly fields. If any of the fields have types that |