From aea417d748969d87d4973a34e055f40ce4a1d739 Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Thu, 14 May 2015 16:45:33 +0200 Subject: generic-match-head.c (types_match): Handle non-types. 2015-05-14 Marc Glisse 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 --- gcc/gimple-match-head.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'gcc/gimple-match-head.c') 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); } -- cgit v1.2.3