===================================================================
@@ -352,7 +352,8 @@ create_mem_ref_raw (tree type, tree alia
/* If possible use a plain MEM_REF instead of a TARGET_MEM_REF. */
if (alias_ptr_type
&& !addr->index
- && !addr->step)
+ && !addr->step
+ && (!addr->base || POINTER_TYPE_P (TREE_TYPE (addr->base))))
{
tree base, offset;
gcc_assert (!addr->symbol ^ !addr->base);
===================================================================
@@ -2610,7 +2679,8 @@ verify_expr (tree *tp, int *walk_subtree
case MEM_REF:
x = TREE_OPERAND (t, 0);
- if (!is_gimple_mem_ref_addr (x))
+ if (!POINTER_TYPE_P (TREE_TYPE (x))
+ || !is_gimple_mem_ref_addr (x))
{
error ("Invalid first operand of MEM_REF.");
return x;