Apply unmerged pull request from upstream:
    
8286562: GCC 12 reports some compiler warnings
https://github.com/openjdk/jdk11u-dev/pull/3091

Index: src/hotspot/share/utilities/globalDefinitions.cpp
--- src/hotspot/share/utilities/globalDefinitions.cpp.orig
+++ src/hotspot/share/utilities/globalDefinitions.cpp
@@ -199,6 +199,17 @@ const char* type2name_tab[T_CONFLICT+1] = {
   "*narrowklass*",
   "*conflict*"
 };
+const char* type2name(BasicType t) {
+  if (t < ARRAY_SIZE(type2name_tab)) {
+    return type2name_tab[t];
+  } else if (t == T_ILLEGAL) {
+    return "*illegal*";
+  } else {
+    fatal("invalid type %d", t);
+    return "invalid type";
+  }
+}
+
 
 
 BasicType name2type(const char* name) {
