diff --git a/gcc/tree.c b/gcc/tree.c
index 72cceda568f5bc7e5a56900934842a2ff09b27e0..0741e3b01af642574f28c537329f27dc9a6502f2 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -13530,7 +13530,7 @@ verify_type (const_tree t)
   tree ct = TYPE_CANONICAL (t);
   if (!ct)
     ;
-  else if (TYPE_CANONICAL (t) != ct)
+  else if (TYPE_CANONICAL (ct) != ct)
     {
       error ("%<TYPE_CANONICAL%> has different %<TYPE_CANONICAL%>");
       debug_tree (ct);