diff options
author | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-10-23 12:18:42 +0000 |
---|---|---|
committer | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-10-23 12:18:42 +0000 |
commit | e58c17e7b132e005fd7f556135b03b1f0ef95f30 (patch) | |
tree | 0fe23e5ff51a04afd7bc7b9f279e3b3b20be309d /gcc/alias.c | |
parent | e1ac6f35ef63aad2654aa55ea0a422aa13be2ce9 (diff) | |
download | gcc-e58c17e7b132e005fd7f556135b03b1f0ef95f30.tar.gz |
PR c/41673
* alias.c (get_alias_set): Call langhook before returning 0 for
types with structural equality.
* c-common.c (c_common_get_alias_set): Use alias set of element
type for arrays with structural comparison.
testsuite:
* gcc.dg/Wstrict-aliasing-bogus-vla-1.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@153496 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/alias.c')
-rw-r--r-- | gcc/alias.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/alias.c b/gcc/alias.c index 694498ab55a..09ec775c5d0 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -691,7 +691,14 @@ get_alias_set (tree t) requires structural comparisons to identify compatible types use alias set zero. */ if (TYPE_STRUCTURAL_EQUALITY_P (t)) - return 0; + { + /* Allow the language to specify another alias set for this + type. */ + set = lang_hooks.get_alias_set (t); + if (set != -1) + return set; + return 0; + } t = TYPE_CANONICAL (t); /* Canonical types shouldn't form a tree nor should the canonical type require structural equality checks. */ |