aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-alias.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2019-05-29 20:13:51 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2019-05-29 18:13:51 +0000
commit01a58e36980830b8a3dfa426f912fce51f7104c4 (patch)
treeddd50f62011ca58db283d81a7ee4ab4586197970 /gcc/tree-ssa-alias.c
parent824e57cbf4115db5dfe90ed49ff9828cbcc14b02 (diff)
downloadgcc-01a58e36980830b8a3dfa426f912fce51f7104c4.zip
gcc-01a58e36980830b8a3dfa426f912fce51f7104c4.tar.gz
gcc-01a58e36980830b8a3dfa426f912fce51f7104c4.tar.bz2
tree-ssa-alias.c (same_type_for_tbaa): Return ture if main variants are pointer equivalent.
* tree-ssa-alias.c (same_type_for_tbaa): Return ture if main variants are pointer equivalent. From-SVN: r271747
Diffstat (limited to 'gcc/tree-ssa-alias.c')
-rw-r--r--gcc/tree-ssa-alias.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c
index 33c15f5..3ecb337 100644
--- a/gcc/tree-ssa-alias.c
+++ b/gcc/tree-ssa-alias.c
@@ -787,6 +787,10 @@ same_type_for_tbaa (tree type1, tree type2)
type1 = TYPE_MAIN_VARIANT (type1);
type2 = TYPE_MAIN_VARIANT (type2);
+ /* Handle the most common case first. */
+ if (type1 == type2)
+ return 1;
+
/* If we would have to do structural comparison bail out. */
if (TYPE_STRUCTURAL_EQUALITY_P (type1)
|| TYPE_STRUCTURAL_EQUALITY_P (type2))