From ee3202e1498c32d3119bcfd52af318585fb3dd72 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 10 Jan 2007 21:03:58 +0000 Subject: [PATCH] tree-pretty-print.c (dump_generic_node): Print parentheses when operands have the same priority. * tree-pretty-print.c (dump_generic_node): Print parentheses when operands have the same priority. From-SVN: r120648 --- gcc/ChangeLog | 5 +++++ gcc/tree-pretty-print.c | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2bb7b53d3ee..6a528142aef 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2007-01-10 Ian Lance Taylor + + * tree-pretty-print.c (dump_generic_node): Print parentheses when + operands have the same priority. + 2007-01-10 Tom Tromey * fold-const.c (fold_truthop): Don't check can_use_bit_fields_p. diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c index d9d4b968a32..a942edc8412 100644 --- a/gcc/tree-pretty-print.c +++ b/gcc/tree-pretty-print.c @@ -1,5 +1,5 @@ /* Pretty formatting of GENERIC trees in C syntax. - Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 + Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Adapted from c-pretty-print.c by Diego Novillo @@ -1259,7 +1259,7 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, /* When the operands are expressions with less priority, keep semantics of the tree representation. */ - if (op_prio (op0) < op_prio (node)) + if (op_prio (op0) <= op_prio (node)) { pp_character (buffer, '('); dump_generic_node (buffer, op0, spc, flags, false); @@ -1274,7 +1274,7 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, /* When the operands are expressions with less priority, keep semantics of the tree representation. */ - if (op_prio (op1) < op_prio (node)) + if (op_prio (op1) <= op_prio (node)) { pp_character (buffer, '('); dump_generic_node (buffer, op1, spc, flags, false);