OSDN Git Service

* tree-pretty-print.c (dump_generic_node): Print parentheses when
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 10 Jan 2007 21:03:58 +0000 (21:03 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 10 Jan 2007 21:03:58 +0000 (21:03 +0000)
operands have the same priority.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120648 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/tree-pretty-print.c

index 2bb7b53..6a52814 100644 (file)
@@ -1,3 +1,8 @@
+2007-01-10  Ian Lance Taylor  <iant@google.com>
+
+       * tree-pretty-print.c (dump_generic_node): Print parentheses when
+       operands have the same priority.
+
 2007-01-10  Tom Tromey  <tromey@redhat.com>
 
        * fold-const.c (fold_truthop): Don't check can_use_bit_fields_p.
 2007-01-10  Tom Tromey  <tromey@redhat.com>
 
        * fold-const.c (fold_truthop): Don't check can_use_bit_fields_p.
index d9d4b96..a942edc 100644 (file)
@@ -1,5 +1,5 @@
 /* Pretty formatting of GENERIC trees in C syntax.
 /* 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 <dnovillo@redhat.com>
 
    Free Software Foundation, Inc.
    Adapted from c-pretty-print.c by Diego Novillo <dnovillo@redhat.com>
 
@@ -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.  */
 
        /* 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);
          {
            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.  */
 
        /* 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);
          {
            pp_character (buffer, '(');
            dump_generic_node (buffer, op1, spc, flags, false);