static void
dump_mem_ref (pretty_printer *pp, tree node, int spc, dump_flags_t flags)
{
- if (flags & TDF_GIMPLE)
+ if (TREE_CODE (node) == MEM_REF && (flags & TDF_GIMPLE))
{
pp_string (pp, "__MEM <");
dump_generic_node (pp, TREE_TYPE (node),
}
pp_right_paren (pp);
}
- else if (integer_zerop (TREE_OPERAND (node, 1))
+ else if (TREE_CODE (node) == MEM_REF
+ && integer_zerop (TREE_OPERAND (node, 1))
/* Dump the types of INTEGER_CSTs explicitly, for we can't
infer them and MEM_ATTR caching will share MEM_REFs
with differently-typed op0s. */
dump_generic_node (pp, op1type, spc, flags | TDF_SLIM, false);
pp_right_paren (pp);
dump_generic_node (pp, op0, spc, flags, false);
- if (!integer_zerop (op1))
- if (!integer_zerop (TREE_OPERAND (node, 1)))
+ if (TREE_CODE (node) == MEM_REF
+ && !integer_zerop (op1))
{
pp_string (pp, " + ");
dump_generic_node (pp, op1, spc, flags, false);
}
+ if (TREE_CODE (node) == TARGET_MEM_REF)
+ {
+ tree tmp = TMR_INDEX2 (node);
+ if (tmp)
+ {
+ pp_string (pp, " + ");
+ dump_generic_node (pp, tmp, spc, flags, false);
+ }
+ tmp = TMR_INDEX (node);
+ if (tmp)
+ {
+ pp_string (pp, " + ");
+ dump_generic_node (pp, tmp, spc, flags, false);
+ tmp = TMR_STEP (node);
+ pp_string (pp, " * ");
+ if (tmp)
+ dump_generic_node (pp, tmp, spc, flags, false);
+ else
+ pp_string (pp, "1");
+ }
+ }
if ((flags & TDF_ALIAS)
&& MR_DEPENDENCE_CLIQUE (node) != 0)
{
break;
case MEM_REF:
- dump_mem_ref (pp, node, spc, flags);
- break;
-
case TARGET_MEM_REF:
- {
- const char *sep = "";
- tree tmp;
-
- pp_string (pp, "MEM[");
-
- if (TREE_CODE (TMR_BASE (node)) == ADDR_EXPR)
- {
- pp_string (pp, sep);
- sep = ", ";
- pp_string (pp, "symbol: ");
- dump_generic_node (pp, TREE_OPERAND (TMR_BASE (node), 0),
- spc, flags, false);
- }
- else
- {
- pp_string (pp, sep);
- sep = ", ";
- pp_string (pp, "base: ");
- dump_generic_node (pp, TMR_BASE (node), spc, flags, false);
- }
- tmp = TMR_INDEX2 (node);
- if (tmp)
- {
- pp_string (pp, sep);
- sep = ", ";
- pp_string (pp, "base: ");
- dump_generic_node (pp, tmp, spc, flags, false);
- }
- tmp = TMR_INDEX (node);
- if (tmp)
- {
- pp_string (pp, sep);
- sep = ", ";
- pp_string (pp, "index: ");
- dump_generic_node (pp, tmp, spc, flags, false);
- }
- tmp = TMR_STEP (node);
- if (tmp)
- {
- pp_string (pp, sep);
- sep = ", ";
- pp_string (pp, "step: ");
- dump_generic_node (pp, tmp, spc, flags, false);
- }
- tmp = TMR_OFFSET (node);
- if (tmp)
- {
- pp_string (pp, sep);
- sep = ", ";
- pp_string (pp, "offset: ");
- dump_generic_node (pp, tmp, spc, flags, false);
- }
- pp_right_bracket (pp);
- }
+ dump_mem_ref (pp, node, spc, flags);
break;
case ARRAY_TYPE: