diff options
| author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-03-03 13:51:26 +0000 |
|---|---|---|
| committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-03-03 13:51:26 +0000 |
| commit | 8713644151ea92118e5d818b87c1eafc31eb14d9 (patch) | |
| tree | f935059d4f4719a4a188bfdb5dd38f0ea3d57064 /gcc/tree-ssa-alias.c | |
| parent | 4b7210115bb4b35bf4af1d9c9e077a61baeb602f (diff) | |
| download | gcc-8713644151ea92118e5d818b87c1eafc31eb14d9.tar.gz | |
2010-03-03 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 157193
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@157194 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-alias.c')
| -rw-r--r-- | gcc/tree-ssa-alias.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c index b235eccf08e..73a16375613 100644 --- a/gcc/tree-ssa-alias.c +++ b/gcc/tree-ssa-alias.c @@ -544,13 +544,15 @@ same_type_for_tbaa (tree type1, tree type2) && TREE_CODE (type2) == ARRAY_TYPE) return -1; - /* In Ada, an lvalue of unconstrained type can be used to access an object - of one of its constrained subtypes, for example when a function with an - unconstrained parameter passed by reference is called on a constrained - object and inlined. In this case, the types have the same alias set. */ - if (TYPE_SIZE (type1) && TYPE_SIZE (type2) - && TREE_CONSTANT (TYPE_SIZE (type1)) != TREE_CONSTANT (TYPE_SIZE (type2)) - && get_alias_set (type1) == get_alias_set (type2)) + /* ??? In Ada, an lvalue of an unconstrained type can be used to access an + object of one of its constrained subtypes, e.g. when a function with an + unconstrained parameter passed by reference is called on an object and + inlined. But, even in the case of a fixed size, type and subtypes are + not equivalent enough as to share the same TYPE_CANONICAL, since this + would mean that conversions between them are useless, whereas they are + not (e.g. type and subtypes can have different modes). So, in the end, + they are only guaranteed to have the same alias set. */ + if (get_alias_set (type1) == get_alias_set (type2)) return -1; /* The types are known to be not equal. */ |
