This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/83463] [8 Regression] ICE: tree check: expected integer_type or enumeral_type or boolean_type or real_type or fixed_point_type, have pointer_type in builtin_memr ef, at gimple-ssa-warn-restrict.c:297


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

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
I'd expect this to fix it:

--- a/gcc/gimple-ssa-warn-restrict.c
+++ b/gcc/gimple-ssa-warn-restrict.c
@@ -287,13 +287,15 @@ builtin_memref::builtin_memref (tree expr, tree size)
          else
            {
              gimple *stmt = SSA_NAME_DEF_STMT (offset);
+             tree type;
              if (is_gimple_assign (stmt)
-             && gimple_assign_rhs_code (stmt) == NOP_EXPR)
+             && gimple_assign_rhs_code (stmt) == NOP_EXPR
+             && (type = TREE_TYPE (gimple_assign_rhs1 (stmt)))
+             && INTEGRAL_TYPE_P (type))
            {
              /* Use the bounds of the type of the NOP_EXPR operand
                 even if it's signed.  The result doesn't trigger
                 warnings but makes their output more readable.  */
-             tree type = TREE_TYPE (gimple_assign_rhs1 (stmt));
              offrange[0] = wi::to_offset (TYPE_MIN_VALUE (type));
              offrange[1] = wi::to_offset (TYPE_MAX_VALUE (type));
            }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]