re PR debug/43443 (We should yank ASM_OPERANDS locs from var-tracking preserved cseli...
authorJakub Jelinek <jakub@redhat.com>
Mon, 22 Mar 2010 10:26:33 +0000 (11:26 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 22 Mar 2010 10:26:33 +0000 (11:26 +0100)
PR debug/43443
* var-tracking.c (add_cselib_value_chains): Remove ASM_OPERANDS
locs from preserved VALUEs.

From-SVN: r157620

gcc/ChangeLog
gcc/var-tracking.c

index 24e5e50..2fa71a6 100644 (file)
@@ -1,3 +1,9 @@
+2010-03-22  Jakub Jelinek  <jakub@redhat.com>
+
+       PR debug/43443
+       * var-tracking.c (add_cselib_value_chains): Remove ASM_OPERANDS
+       locs from preserved VALUEs.
+
 2010-03-21  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
 
        PR middle-end/42718
index c11d119..cec6c34 100644 (file)
@@ -2791,15 +2791,23 @@ add_value_chains (decl_or_value dv, rtx loc)
 }
 
 /* If CSELIB_VAL_PTR of value DV refer to VALUEs, add backlinks from those
-   VALUEs to DV.  */
+   VALUEs to DV.  Add the same time get rid of ASM_OPERANDS from locs list,
+   that is something we never can express in .debug_info and can prevent
+   reverse ops from being used.  */
 
 static void
 add_cselib_value_chains (decl_or_value dv)
 {
-  struct elt_loc_list *l;
+  struct elt_loc_list **l;
 
-  for (l = CSELIB_VAL_PTR (dv_as_value (dv))->locs; l; l = l->next)
-    for_each_rtx (&l->loc, add_value_chain, dv_as_opaque (dv));
+  for (l = &CSELIB_VAL_PTR (dv_as_value (dv))->locs; *l;)
+    if (GET_CODE ((*l)->loc) == ASM_OPERANDS)
+      *l = (*l)->next;
+    else
+      {
+       for_each_rtx (&(*l)->loc, add_value_chain, dv_as_opaque (dv));
+       l = &(*l)->next;
+      }
 }
 
 /* If decl or value DVP refers to VALUE from *LOC, remove backlinks