OSDN Git Service

PR debug/41371
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 13 Jan 2010 13:26:47 +0000 (13:26 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 13 Jan 2010 13:26:47 +0000 (13:26 +0000)
* var-tracking.c (values_to_unmark): New variable.
(find_loc_in_1pdv): Clear VALUE_RECURSED_INTO of values in
values_to_unmark vector.  Moved body to...
(find_loc_in_1pdv_1): ... this.  Don't clear VALUE_RECURSED_INTO,
instead queue it into values_to_unmark vector.
(vt_find_locations): Free values_to_unmark vector.

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

gcc/ChangeLog
gcc/var-tracking.c

index b619561..5b291e6 100644 (file)
@@ -1,3 +1,13 @@
+2010-01-13  Jakub Jelinek  <jakub@redhat.com>
+
+       PR debug/41371
+       * var-tracking.c (values_to_unmark): New variable.
+       (find_loc_in_1pdv): Clear VALUE_RECURSED_INTO of values in
+       values_to_unmark vector.  Moved body to...
+       (find_loc_in_1pdv_1): ... this.  Don't clear VALUE_RECURSED_INTO,
+       instead queue it into values_to_unmark vector.
+       (vt_find_locations): Free values_to_unmark vector.
+
 2010-01-13  Wolfgang Gellerich  <gellerich@de.ibm.com>
 
        * config/s390/s390.c (override_options): Set
index db7778b..0822fec 100644 (file)
@@ -1,5 +1,5 @@
 /* Variable tracking routines for the GNU compiler.
-   Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009
+   Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
    Free Software Foundation, Inc.
 
    This file is part of GCC.
@@ -2252,12 +2252,18 @@ dv_changed_p (decl_or_value dv)
          : DECL_CHANGED (dv_as_decl (dv)));
 }
 
-/* Return a location list node whose loc is rtx_equal to LOC, in the
+/* Vector of VALUEs that should have VALUE_RECURSED_INTO bit cleared
+   at the end of find_loc_in_1pdv.  Not a static variable in find_loc_in_1pdv
+   to avoid constant allocation/freeing of it.  */
+static VEC(rtx, heap) *values_to_unmark;
+
+/* Helper function for find_loc_in_1pdv.
+   Return a location list node whose loc is rtx_equal to LOC, in the
    location list of a one-part variable or value VAR, or in that of
    any values recursively mentioned in the location lists.  */
 
 static location_chain
-find_loc_in_1pdv (rtx loc, variable var, htab_t vars)
+find_loc_in_1pdv_1 (rtx loc, variable var, htab_t vars)
 {
   location_chain node;
 
@@ -2285,18 +2291,33 @@ find_loc_in_1pdv (rtx loc, variable var, htab_t vars)
          {
            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;
+           VEC_safe_push (rtx, heap, values_to_unmark, node->loc);
+           if ((where = find_loc_in_1pdv_1 (loc, var, vars)))
+             return where;
          }
       }
 
   return NULL;
 }
 
+/* Return a location list node whose loc is rtx_equal to LOC, in the
+   location list of a one-part variable or value VAR, or in that of
+   any values recursively mentioned in the location lists.  */
+
+static location_chain
+find_loc_in_1pdv (rtx loc, variable var, htab_t vars)
+{
+  location_chain ret;
+  unsigned int i;
+  rtx value;
+
+  ret = find_loc_in_1pdv_1 (loc, var, vars);
+  for (i = 0; VEC_iterate (rtx, values_to_unmark, i, value); i++)
+    VALUE_RECURSED_INTO (value) = false;
+  VEC_truncate (rtx, values_to_unmark, 0);
+  return ret;
+}
+
 /* Hash table iteration argument passed to variable_merge.  */
 struct dfset_merge
 {
@@ -5648,6 +5669,7 @@ vt_find_locations (void)
     FOR_EACH_BB (bb)
       gcc_assert (VTI (bb)->flooded);
 
+  VEC_free (rtx, heap, values_to_unmark);
   free (bb_order);
   fibheap_delete (worklist);
   fibheap_delete (pending);