OSDN Git Service

PR debug/50869
authoraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 1 Nov 2011 02:09:00 +0000 (02:09 +0000)
committeraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 1 Nov 2011 02:09:00 +0000 (02:09 +0000)
* cselib.c (cfa_base_preserved_regno): Initialize.
(cselib_expand_value_rtx_1): Don't expand it.
* var-tracking.c (vt_expand_var_loc_chain): Initialize depth.
Check it's only zero if result is NULL.

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

gcc/ChangeLog
gcc/cselib.c
gcc/var-tracking.c

index 821e0e5..d5f725b 100644 (file)
@@ -1,3 +1,11 @@
+2011-11-01  Alexandre Oliva  <aoliva@redhat.com>
+
+       PR debug/50869
+       * cselib.c (cfa_base_preserved_regno): Initialize.
+       (cselib_expand_value_rtx_1): Don't expand it.
+       * var-tracking.c (vt_expand_var_loc_chain): Initialize depth.
+       Check it's only zero if result is NULL.
+
 2011-11-01  Jakub Jelinek  <jakub@redhat.com>
 
        * config/i386/sse.md (fixuns_trunc<mode><sseintvecmodelower>2): New
index b96c0cd..ef397db 100644 (file)
@@ -185,7 +185,7 @@ static cselib_val dummy_val;
    that is constant through the whole function and should never be
    eliminated.  */
 static cselib_val *cfa_base_preserved_val;
-static unsigned int cfa_base_preserved_regno;
+static unsigned int cfa_base_preserved_regno = INVALID_REGNUM;
 
 /* Used to list all values that contain memory reference.
    May or may not contain the useless values - the list is compacted
@@ -1451,7 +1451,7 @@ cselib_expand_value_rtx_1 (rtx orig, struct expand_value_data *evd,
          if (GET_MODE (l->elt->val_rtx) == GET_MODE (orig))
            {
              rtx result;
-             int regno = REGNO (orig);
+             unsigned regno = REGNO (orig);
 
              /* The only thing that we are not willing to do (this
                 is requirement of dse and if others potential uses
@@ -1471,7 +1471,8 @@ cselib_expand_value_rtx_1 (rtx orig, struct expand_value_data *evd,
                 make the frame assumptions.  */
              if (regno == STACK_POINTER_REGNUM
                  || regno == FRAME_POINTER_REGNUM
-                 || regno == HARD_FRAME_POINTER_REGNUM)
+                 || regno == HARD_FRAME_POINTER_REGNUM
+                 || regno == cfa_base_preserved_regno)
                return orig;
 
              bitmap_set_bit (evd->regs_active, regno);
index 44bab38..11d4efd 100644 (file)
@@ -7764,7 +7764,7 @@ vt_expand_var_loc_chain (variable var, bitmap regs, void *data, bool *pendrecp)
   bool pending_recursion;
   rtx loc_from = NULL;
   struct elt_loc_list *cloc = NULL;
-  int depth, saved_depth = elcd->depth;
+  int depth = 0, saved_depth = elcd->depth;
 
   /* Clear all backlinks pointing at this, so that we're not notified
      while we're active.  */
@@ -7842,6 +7842,8 @@ vt_expand_var_loc_chain (variable var, bitmap regs, void *data, bool *pendrecp)
   VAR_LOC_FROM (var) = loc_from;
   VAR_LOC_DEPTH (var) = depth;
 
+  gcc_checking_assert (!depth == !result);
+
   elcd->depth = update_depth (saved_depth, depth);
 
   /* Indicate whether any of the dependencies are pending recursion