OSDN Git Service

2005-09-28 Richard Guenther <rguenther@suse.de>
[pf3gnuchains/gcc-fork.git] / gcc / tree-pretty-print.c
index 1922be7..6fa0326 100644 (file)
@@ -16,8 +16,8 @@ for more details.
 
 You should have received a copy of the GNU General Public License
 along with GCC; see the file COPYING.  If not, write to the Free
-Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.  */
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA.  */
 
 #include "config.h"
 #include "system.h"
@@ -31,6 +31,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "langhooks.h"
 #include "tree-iterator.h"
 #include "tree-chrec.h"
+#include "tree-pass.h"
 
 /* Local functions, macros and variables.  */
 static int op_prio (tree);
@@ -267,7 +268,8 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
   if (TREE_CODE (node) != ERROR_MARK
       && is_gimple_stmt (node)
       && (flags & TDF_VOPS)
-      && stmt_ann (node))
+      && stmt_ann (node)
+      && TREE_CODE (node) != PHI_NODE)
     dump_vops (buffer, node, spc, flags);
 
   if (is_stmt && (flags & TDF_STMTADDR))
@@ -776,36 +778,29 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
 
     case CONSTRUCTOR:
       {
-       tree lnode;
+       unsigned HOST_WIDE_INT ix;
+       tree field, val;
        bool is_struct_init = FALSE;
        pp_character (buffer, '{');
-       lnode = CONSTRUCTOR_ELTS (node);
        if (TREE_CODE (TREE_TYPE (node)) == RECORD_TYPE
            || TREE_CODE (TREE_TYPE (node)) == UNION_TYPE)
          is_struct_init = TRUE;
-       while (lnode && lnode != error_mark_node)
+       FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (node), ix, field, val)
          {
-           tree val;
-           if (TREE_PURPOSE (lnode) && is_struct_init)
+           if (field && is_struct_init)
              {
                pp_character (buffer, '.');
-               dump_generic_node (buffer, TREE_PURPOSE (lnode), spc, flags, false);
+               dump_generic_node (buffer, field, spc, flags, false);
                pp_string (buffer, "=");
              }
-           val = TREE_VALUE (lnode);
            if (val && TREE_CODE (val) == ADDR_EXPR)
              if (TREE_CODE (TREE_OPERAND (val, 0)) == FUNCTION_DECL)
                val = TREE_OPERAND (val, 0);
            if (val && TREE_CODE (val) == FUNCTION_DECL)
-             {
                dump_decl_name (buffer, val, flags);
-             }
            else
-             {
-               dump_generic_node (buffer, TREE_VALUE (lnode), spc, flags, false);
-             }
-           lnode = TREE_CHAIN (lnode);
-           if (lnode && TREE_CODE (lnode) == TREE_LIST)
+               dump_generic_node (buffer, val, spc, flags, false);
+           if (ix != VEC_length (constructor_elt, CONSTRUCTOR_ELTS (node)) - 1)
              {
                pp_character (buffer, ',');
                pp_space (buffer);
@@ -1003,8 +998,8 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
          pp_character (buffer, ']');
        }
 
-      if (CALL_EXPR_HAS_RETURN_SLOT_ADDR (node))
-       pp_string (buffer, " [return slot addr]");
+      if (CALL_EXPR_RETURN_SLOT_OPT (node))
+       pp_string (buffer, " [return slot optimization]");
       if (CALL_EXPR_TAILCALL (node))
        pp_string (buffer, " [tail call]");
       break;
@@ -1043,6 +1038,8 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
     case RSHIFT_EXPR:
     case LROTATE_EXPR:
     case RROTATE_EXPR:
+    case VEC_LSHIFT_EXPR:
+    case VEC_RSHIFT_EXPR:
     case BIT_IOR_EXPR:
     case BIT_XOR_EXPR:
     case BIT_AND_EXPR:
@@ -1574,7 +1571,7 @@ print_declaration (pretty_printer *buffer, tree t, int spc, int flags)
   if (TREE_CODE (t) == TYPE_DECL)
     pp_string (buffer, "typedef ");
 
-  if (DECL_REGISTER (t))
+  if (CODE_CONTAINS_STRUCT (TREE_CODE (t), TS_DECL_WRTL) && DECL_REGISTER (t))
     pp_string (buffer, "register ");
 
   if (TREE_PUBLIC (t) && DECL_EXTERNAL (t))
@@ -1838,6 +1835,8 @@ op_prio (tree op)
     case REDUC_MAX_EXPR:
     case REDUC_MIN_EXPR:
     case REDUC_PLUS_EXPR:
+    case VEC_LSHIFT_EXPR:
+    case VEC_RSHIFT_EXPR:
       return 16;
 
     case SAVE_EXPR:
@@ -1925,6 +1924,12 @@ op_symbol (tree op)
     case RSHIFT_EXPR:
       return ">>";
 
+    case VEC_LSHIFT_EXPR:
+      return "v<<";
+
+    case VEC_RSHIFT_EXPR:
+      return "v>>";
     case PLUS_EXPR:
       return "+";
 
@@ -2242,6 +2247,16 @@ dump_bb_header (pretty_printer *buffer, basic_block bb, int indent, int flags)
       INDENT (indent);
       pp_string (buffer, "# BLOCK ");
       pp_decimal_int (buffer, bb->index);
+      if (bb->frequency)
+       {
+          pp_string (buffer, " freq:");
+          pp_decimal_int (buffer, bb->frequency);
+       }
+      if (bb->count)
+       {
+          pp_string (buffer, " count:");
+          pp_widest_integer (buffer, bb->count);
+       }
 
       if (flags & TDF_LINENO)
        {