OSDN Git Service

PR debug/41371
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 18 May 2010 09:35:52 +0000 (09:35 +0000)
committerMasaki Muranaka <monaka@monami-software.com>
Sun, 23 May 2010 05:11:19 +0000 (14:11 +0900)
* var-tracking.c (find_loc_in_1pdv): Add a few checks from
rtx_equal_p inline.

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

gcc/ChangeLog
gcc/var-tracking.c

index 56d1b0b..064e8f1 100644 (file)
@@ -1,3 +1,9 @@
+2010-05-18  Jakub Jelinek  <jakub@redhat.com>
+
+       PR debug/41371
+       * var-tracking.c (find_loc_in_1pdv): Add a few checks from
+       rtx_equal_p inline.
+
 2010-05-18  Steven Bosscher  <steven@gcc.gnu.org>
 
        * config.gcc (powerpc-*-darwin*, powerpc64-*-darwin*): Add
index b2c828a..0c41312 100644 (file)
@@ -2484,6 +2484,7 @@ static location_chain
 find_loc_in_1pdv (rtx loc, variable var, htab_t vars)
 {
   location_chain node;
+  enum rtx_code loc_code;
 
   if (!var)
     return NULL;
@@ -2495,28 +2496,41 @@ find_loc_in_1pdv (rtx loc, variable var, htab_t vars)
 
   gcc_assert (var->var_part[0].offset == 0);
 
+  loc_code = GET_CODE (loc);
   for (node = var->var_part[0].loc_chain; node; node = node->next)
-    if (rtx_equal_p (loc, node->loc))
-      return node;
-    else if (GET_CODE (node->loc) == VALUE
-            && !VALUE_RECURSED_INTO (node->loc))
-      {
-       decl_or_value dv = dv_from_value (node->loc);
-       variable var = (variable)
-                      htab_find_with_hash (vars, dv, dv_htab_hash (dv));
+    {
+      if (GET_CODE (node->loc) != loc_code)
+       {
+         if (GET_CODE (node->loc) != VALUE)
+           continue;
+       }
+      else if (loc == node->loc)
+       return node;
+      else if (loc_code != VALUE)
+       {
+         if (rtx_equal_p (loc, node->loc))
+           return node;
+         continue;
+       }
+      if (!VALUE_RECURSED_INTO (node->loc))
+       {
+         decl_or_value dv = dv_from_value (node->loc);
+         variable var = (variable)
+                        htab_find_with_hash (vars, dv, dv_htab_hash (dv));
 
-       if (var)
-         {
-           location_chain where;
-           VALUE_RECURSED_INTO (node->loc) = true;
-           if ((where = find_loc_in_1pdv (loc, var, vars)))
-             {
-               VALUE_RECURSED_INTO (node->loc) = false;
-               return where;
-             }
-           VALUE_RECURSED_INTO (node->loc) = false;
-         }
-      }
+         if (var)
+           {
+             location_chain where;
+             VALUE_RECURSED_INTO (node->loc) = true;
+             if ((where = find_loc_in_1pdv (loc, var, vars)))
+               {
+                 VALUE_RECURSED_INTO (node->loc) = false;
+                 return where;
+               }
+             VALUE_RECURSED_INTO (node->loc) = false;
+           }
+       }
+    }
 
   return NULL;
 }