From: Richard Kenner Date: Thu, 1 Jul 2004 19:32:27 +0000 (+0000) Subject: tree-pretty-print.c (dump_generic_node, [...]): Use access functions for lower bound... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8e6b96d398270fe98716792740ac2d50d2a464c4;p=gcc.git tree-pretty-print.c (dump_generic_node, [...]): Use access functions for lower bound and element size and only output if... * tree-pretty-print.c (dump_generic_node, case ARRAY_REF): Use access functions for lower bound and element size and only output if lower bound nonzero or element size not same as that of type. (dump_generic_node, case COMPONENT_REF): Use access func. for offset. From-SVN: r83997 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 95961e6ebce..1850bc844d0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2004-07-01 Richard Kenner + + * tree-pretty-print.c (dump_generic_node, case ARRAY_REF): Use + access functions for lower bound and element size and only output + if lower bound nonzero or element size not same as that of type. + (dump_generic_node, case COMPONENT_REF): Use access func. for offset. + 2004-07-01 Paolo Bonzini * c-pretty-print.c (pp_c_postfix_expression): Fix pasto. diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c index 9d415fa8873..188faff0219 100644 --- a/gcc/tree-pretty-print.c +++ b/gcc/tree-pretty-print.c @@ -611,12 +611,12 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, pp_character (buffer, ')'); pp_string (buffer, str); dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags, false); - if (TREE_OPERAND (node, 2) - && TREE_CODE (TREE_OPERAND (node, 2)) != INTEGER_CST) + + op0 = component_ref_field_offset (node); + if (op0 && TREE_CODE (op0) != INTEGER_CST) { pp_string (buffer, "{off: "); - dump_generic_node (buffer, TREE_OPERAND (node, 2), - spc, flags, false); + dump_generic_node (buffer, op0, spc, flags, false); pp_character (buffer, '}'); } break; @@ -649,17 +649,17 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, pp_string (buffer, " ..."); pp_character (buffer, ']'); - if ((TREE_OPERAND (node, 2) - && TREE_CODE (TREE_OPERAND (node, 2)) != INTEGER_CST) - || (TREE_OPERAND (node, 3) - && TREE_CODE (TREE_OPERAND (node, 3)) != INTEGER_CST)) + op0 = array_ref_low_bound (node); + op1 = array_ref_element_size (node); + + if (!integer_zerop (op0) + || (TYPE_SIZE_UNIT (TREE_TYPE (node)) + && !operand_equal_p (op1, TYPE_SIZE_UNIT (TREE_TYPE (node)), 0))) { pp_string (buffer, "{lb: "); - dump_generic_node (buffer, TREE_OPERAND (node, 2), - spc, flags, false); + dump_generic_node (buffer, op0, spc, flags, false); pp_string (buffer, " sz: "); - dump_generic_node (buffer, TREE_OPERAND (node, 3), - spc, flags, false); + dump_generic_node (buffer, op1, spc, flags, false); pp_character (buffer, '}'); } break;