diff gcc/tree-ssa-coalesce.c @ 63:b7f97abdc517 gcc-4.6-20100522

update gcc from gcc-4.5.0 to gcc-4.6
author ryoma <e075725@ie.u-ryukyu.ac.jp>
date Mon, 24 May 2010 12:47:05 +0900
parents 77e2b8dfacca
children f6334be47118
line wrap: on
line diff
--- a/gcc/tree-ssa-coalesce.c	Fri Feb 12 23:41:23 2010 +0900
+++ b/gcc/tree-ssa-coalesce.c	Mon May 24 12:47:05 2010 +0900
@@ -1,5 +1,5 @@
 /* Coalesce SSA_NAMES together for the out-of-ssa pass.
-   Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009
+   Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
    Free Software Foundation, Inc.
    Contributed by Andrew MacLeod <amacleod@redhat.com>
 
@@ -26,6 +26,7 @@
 #include "tree.h"
 #include "flags.h"
 #include "diagnostic.h"
+#include "tree-pretty-print.h"
 #include "bitmap.h"
 #include "tree-flow.h"
 #include "hashtab.h"
@@ -256,7 +257,7 @@
 static coalesce_pair_p
 find_coalesce_pair (coalesce_list_p cl, int p1, int p2, bool create)
 {
-  struct coalesce_pair p, *pair;
+  struct coalesce_pair p;
   void **slot;
   unsigned int hash;
 
@@ -272,22 +273,23 @@
       p.second_element = p2;
     }
 
-
   hash = coalesce_pair_map_hash (&p);
-  pair = (struct coalesce_pair *) htab_find_with_hash (cl->list, &p, hash);
+  slot = htab_find_slot_with_hash (cl->list, &p, hash,
+				   create ? INSERT : NO_INSERT);
+  if (!slot)
+    return NULL;
 
-  if (create && !pair)
+  if (!*slot)
     {
+      struct coalesce_pair * pair = XNEW (struct coalesce_pair);
       gcc_assert (cl->sorted == NULL);
-      pair = XNEW (struct coalesce_pair);
       pair->first_element = p.first_element;
       pair->second_element = p.second_element;
       pair->cost = 0;
-      slot = htab_find_slot_with_hash (cl->list, pair, hash, INSERT);
-      *(struct coalesce_pair **)slot = pair;
+      *slot = (void *)pair;
     }
 
-  return pair;
+  return (struct coalesce_pair *) *slot;
 }
 
 static inline void