This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[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
- From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 18 Dec 2017 13:37:35 +0000
- Subject: [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
- Auto-submitted: auto-generated
- References: <bug-83463-4@http.gcc.gnu.org/bugzilla/>
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));
}