]> gcc.gnu.org Git - gcc.git/commitdiff
tree-ssa-operands.c (get_asm_expr_operands): Fix thinkos in the handling of clobberin...
authorDiego Novillo <dnovillo@redhat.com>
Thu, 8 Jul 2004 15:03:10 +0000 (15:03 +0000)
committerDiego Novillo <dnovillo@gcc.gnu.org>
Thu, 8 Jul 2004 15:03:10 +0000 (11:03 -0400)
* tree-ssa-operands.c (get_asm_expr_operands): Fix thinkos in
the handling of clobbering ASM_EXPRs.

From-SVN: r84292

gcc/ChangeLog
gcc/tree-ssa-operands.c

index 8e24df935fdc44e1e4751e18ae1e1ded1c32641c..d9152d9b7efaf92496924b28d52cf3aec3d432c9 100644 (file)
@@ -1,3 +1,8 @@
+2004-07-08  Diego Novillo  <dnovillo@redhat.com>
+
+       * tree-ssa-operands.c (get_asm_expr_operands): Fix thinkos in
+       the handling of clobbering ASM_EXPRs.
+
 2004-07-08  Eric Botcazou  <ebotcazou@libertysurf.fr>
 
        PR target/16430
index 46f9f59ac0458068ca6cf9ece33382d2599f0ce5..90b9d022b556706300737eee62e3518798589568 100644 (file)
@@ -1164,8 +1164,9 @@ get_expr_operands (tree stmt, tree *expr_p, int flags, voperands_t prev_vops)
   abort ();
 }
 
-/* Scan operands in ASM_EXPR STMT.  PREV_VOPS is as in
-   append_v_may_def and append_vuse.  */
+
+/* Scan operands in ASM_EXPR STMT.  PREV_VOPS is as in append_v_may_def and
+   append_vuse.  */
 
 static void
 get_asm_expr_operands (tree stmt, voperands_t prev_vops)
@@ -1223,47 +1224,43 @@ get_asm_expr_operands (tree stmt, voperands_t prev_vops)
       get_expr_operands (stmt, &TREE_VALUE (link), 0, prev_vops);
     }
 
+
   /* Clobber memory for asm ("" : : : "memory");  */
-  if (!aliases_computed_p)
-    {
-      /* If we still have not computed aliasing information,
-        mark the statement as having volatile operands to avoid
-        optimizations from messing around with it.  */
-      stmt_ann (stmt)->has_volatile_ops = true;
-    }
-  else
-    {
-      /* Otherwise, if this ASM_EXPR clobbers memory, clobber
-        all the call-clobbered variables and the addressable
-        variables found by the alias analyzer.  */
-      for (link = ASM_CLOBBERS (stmt); link; link = TREE_CHAIN (link))
-       if (!strcmp (TREE_STRING_POINTER (TREE_VALUE (link)), "memory"))
+  for (link = ASM_CLOBBERS (stmt); link; link = TREE_CHAIN (link))
+    if (strcmp (TREE_STRING_POINTER (TREE_VALUE (link)), "memory") == 0)
+      {
+       size_t i;
+
+       /* If we still have not computed aliasing information, we
+          won't know what variables are call-clobbered and/or
+          addressable.  Just mark the statement as having volatile
+          operands for now.  */
+       if (!aliases_computed_p)
          {
-           /* If we had created .GLOBAL_VAR earlier, use it.
-              Otherwise, add a V_MAY_DEF operand for every
-              call-clobbered and addressable variable.  See
-              compute_may_aliases for the heuristic used to decide
-              whether to create .GLOBAL_VAR or not.  */
-           if (global_var)
-             add_stmt_operand (&global_var, stmt, opf_is_def, prev_vops);
-           else
+           stmt_ann (stmt)->has_volatile_ops = true;
+           break;
+         }
+
+       /* Clobber all call-clobbered variables (or .GLOBAL_VAR if we
+          decided to group them).  */
+       if (global_var)
+         add_stmt_operand (&global_var, stmt, opf_is_def, prev_vops);
+       else
+         EXECUTE_IF_SET_IN_BITMAP (call_clobbered_vars, 0, i,
              {
-               size_t i;
+               tree var = referenced_var (i);
+               add_stmt_operand (&var, stmt, opf_is_def, prev_vops);
+             });
 
-               EXECUTE_IF_SET_IN_BITMAP (call_clobbered_vars, 0, i,
-                   {
-                     tree var = referenced_var (i);
-                     add_stmt_operand (&var, stmt, opf_is_def, prev_vops);
-                   });
+       /* Now clobber all addressables.  */
+       EXECUTE_IF_SET_IN_BITMAP (addressable_vars, 0, i,
+           {
+             tree var = referenced_var (i);
+             add_stmt_operand (&var, stmt, opf_is_def, prev_vops);
+           });
 
-               EXECUTE_IF_SET_IN_BITMAP (addressable_vars, 0, i,
-                   {
-                     tree var = referenced_var (i);
-                     add_stmt_operand (&var, stmt, opf_is_def, prev_vops);
-                   });
-             }
-         }
-    }
+       break;
+      }
 }
 
 
This page took 0.106734 seconds and 5 git commands to generate.