summaryrefslogtreecommitdiff
path: root/gcc/gimple-match-head.c
diff options
context:
space:
mode:
authorMarc Glisse <marc.glisse@inria.fr>2015-05-14 16:45:33 +0200
committerMarc Glisse <glisse@gcc.gnu.org>2015-05-14 14:45:33 +0000
commitaea417d748969d87d4973a34e055f40ce4a1d739 (patch)
tree3f458e1179a5b2faa934d97e293a20431f09ecda /gcc/gimple-match-head.c
parentddbd742bf84e7ed28d9d37d2c7b4cc9f3d7d05c0 (diff)
generic-match-head.c (types_match): Handle non-types.
2015-05-14 Marc Glisse <marc.glisse@inria.fr> gcc/ * generic-match-head.c (types_match): Handle non-types. * gimple-match-head.c (types_match): Likewise. * match.pd: Remove unnecessary TREE_TYPE for types_match. From-SVN: r223199
Diffstat (limited to 'gcc/gimple-match-head.c')
-rw-r--r--gcc/gimple-match-head.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/gimple-match-head.c b/gcc/gimple-match-head.c
index 7b9348b53ec..cac037b31df 100644
--- a/gcc/gimple-match-head.c
+++ b/gcc/gimple-match-head.c
@@ -862,11 +862,17 @@ do_valueize (tree (*valueize)(tree), tree op)
}
/* Routine to determine if the types T1 and T2 are effectively
- the same for GIMPLE. */
+ the same for GIMPLE. If T1 or T2 is not a type, the test
+ applies to their TREE_TYPE. */
static inline bool
types_match (tree t1, tree t2)
{
+ if (!TYPE_P (t1))
+ t1 = TREE_TYPE (t1);
+ if (!TYPE_P (t2))
+ t2 = TREE_TYPE (t2);
+
return types_compatible_p (t1, t2);
}