OSDN Git Service

* var-tracking.c (emit_note_insn_var_location): For one part
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 26 Mar 2010 20:54:43 +0000 (20:54 +0000)
committerMasaki Muranaka <monaka@monami-software.com>
Sun, 23 May 2010 00:37:15 +0000 (09:37 +0900)
notes with offset 0, don't add EXPR_LIST around the location.
* dwarf2out.c (loc_descriptor, dw_loc_list_1,
add_location_or_const_value_attribute): Adjust for that change.

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

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

index 528a299..85cd6c7 100644 (file)
@@ -1,5 +1,10 @@
 2010-03-26  Jakub Jelinek  <jakub@redhat.com>
 
 2010-03-26  Jakub Jelinek  <jakub@redhat.com>
 
+       * var-tracking.c (emit_note_insn_var_location): For one part
+       notes with offset 0, don't add EXPR_LIST around the location.
+       * dwarf2out.c (loc_descriptor, dw_loc_list_1,
+       add_location_or_const_value_attribute): Adjust for that change.
+
        PR debug/43540
        * dwarf2out.c (reg_save): For DW_CFA_expression put regnum
        into first operand and location into second.
        PR debug/43540
        * dwarf2out.c (reg_save): For DW_CFA_expression put regnum
        into first operand and location into second.
index bd75de9..a3de759 100644 (file)
@@ -13731,10 +13731,12 @@ loc_descriptor (rtx rtl, enum machine_mode mode,
 
     case VAR_LOCATION:
       /* Single part.  */
 
     case VAR_LOCATION:
       /* Single part.  */
-      if (GET_CODE (XEXP (rtl, 1)) != PARALLEL)
+      if (GET_CODE (PAT_VAR_LOCATION_LOC (rtl)) != PARALLEL)
        {
        {
-         loc_result = loc_descriptor (XEXP (XEXP (rtl, 1), 0), mode,
-                                      initialized);
+         rtx loc = PAT_VAR_LOCATION_LOC (rtl);
+         if (GET_CODE (loc) == EXPR_LIST)
+           loc = XEXP (loc, 0);
+         loc_result = loc_descriptor (loc, mode, initialized);
          break;
        }
 
          break;
        }
 
@@ -13986,9 +13988,11 @@ dw_loc_list_1 (tree loc, rtx varloc, int want_address,
     {
       gcc_assert (GET_CODE (varloc) == VAR_LOCATION);
       /* Single part.  */
     {
       gcc_assert (GET_CODE (varloc) == VAR_LOCATION);
       /* Single part.  */
-      if (GET_CODE (XEXP (varloc, 1)) != PARALLEL)
+      if (GET_CODE (PAT_VAR_LOCATION_LOC (varloc)) != PARALLEL)
        {
        {
-         varloc = XEXP (XEXP (varloc, 1), 0);
+         varloc = PAT_VAR_LOCATION_LOC (varloc);
+         if (GET_CODE (varloc) == EXPR_LIST)
+           varloc = XEXP (varloc, 0);
          mode = GET_MODE (varloc);
          if (MEM_P (varloc))
            {
          mode = GET_MODE (varloc);
          if (MEM_P (varloc))
            {
@@ -15891,7 +15895,7 @@ add_location_or_const_value_attribute (dw_die_ref die, tree decl,
 
       node = loc_list->first;
       rtl = NOTE_VAR_LOCATION_LOC (node->var_loc_note);
 
       node = loc_list->first;
       rtl = NOTE_VAR_LOCATION_LOC (node->var_loc_note);
-      if (GET_CODE (rtl) != PARALLEL)
+      if (GET_CODE (rtl) == EXPR_LIST)
        rtl = XEXP (rtl, 0);
       if ((CONSTANT_P (rtl) || GET_CODE (rtl) == CONST_STRING)
          && add_const_value_attribute (die, rtl))
        rtl = XEXP (rtl, 0);
       if ((CONSTANT_P (rtl) || GET_CODE (rtl) == CONST_STRING)
          && add_const_value_attribute (die, rtl))
index cec6c34..d1ecc86 100644 (file)
@@ -7099,8 +7099,12 @@ emit_note_insn_var_location (void **varp, void *data)
                                    (int) initialized);
   else if (n_var_parts == 1)
     {
                                    (int) initialized);
   else if (n_var_parts == 1)
     {
-      rtx expr_list
-       = gen_rtx_EXPR_LIST (VOIDmode, loc[0], GEN_INT (offsets[0]));
+      rtx expr_list;
+
+      if (offsets[0] || GET_CODE (loc[0]) == PARALLEL)
+       expr_list = gen_rtx_EXPR_LIST (VOIDmode, loc[0], GEN_INT (offsets[0]));
+      else
+       expr_list = loc[0];
 
       note_vl = gen_rtx_VAR_LOCATION (VOIDmode, decl, expr_list,
                                      (int) initialized);
 
       note_vl = gen_rtx_VAR_LOCATION (VOIDmode, decl, expr_list,
                                      (int) initialized);