From 01a58e36980830b8a3dfa426f912fce51f7104c4 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Wed, 29 May 2019 20:13:51 +0200 Subject: [PATCH] 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 --- gcc/ChangeLog | 5 +++++ gcc/tree-ssa-alias.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4452293257c..a3056bfcafe 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2019-05-29 Jan Hubicka + + * tree-ssa-alias.c (same_type_for_tbaa): Return ture if main + variants are pointer equivalent. + 2019-05-29 Alejandro Martinez * config/aarch64/aarch64-c.c: Added TARGET_SVE2. diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c index 33c15f52beb..3ecb337ffdf 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)) -- 2.30.2