aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-match-head.c
diff options
context:
space:
mode:
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 7b9348b..cac037b 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);
}