[Bug tree-optimization/101162] [12 Regression] ICE (verify_gimple failed) for switch returning pointer-to-members since r12-1608

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jun 22 09:11:17 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101162

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I was just about to assign this to myself as I had just came up with a fix:
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 85e90f42b8e..5e4bdeace1e 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -5361,7 +5361,7 @@ range_check_type (tree etype)
       else
        return NULL_TREE;
     }
-  else if (POINTER_TYPE_P (etype))
+  else if (POINTER_TYPE_P (etype) || TREE_CODE (etype) == OFFSET_TYPE)
     etype = unsigned_type_for (etype);
   return etype;
 }


More information about the Gcc-bugs mailing list