This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Remove ASM_STMT


Replaced with ASM_EXPR, which has 100% identical semantics.


r~



        * c-common.def (ASM_STMT): Remove.
        * c-common.h (c_common_stmt_codes): Remove ASM_STMT.
        * c-dump.c (c_dump_tree): Likewise.
        * c-gimplify.c (c_gimplify_stmt): Likewise.
        * c-pretty-print.c (pp_c_statement): Likewise.
        * c-typeck.c (build_asm_expr): Use ASM_EXPR.
        * tree.h: Fix commentary.
cp/
        * parser.c (cp_parser_asm_definition): Update commentary.
        * pt.c (tsubst_expr): Use ASM_EXPR.
        * semantics.c (finish_asm_stmt): Likewise.

Index: gcc/c-common.def
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-common.def,v
retrieving revision 1.17
diff -c -p -d -u -r1.17 c-common.def
--- gcc/c-common.def	16 Jun 2004 18:21:12 -0000	1.17
+++ gcc/c-common.def	16 Jun 2004 20:13:05 -0000
@@ -71,9 +71,6 @@ DEFTREECODE (CONTINUE_STMT, "continue_st
    SWITCH_COND, SWITCH_BODY and SWITCH_TYPE, respectively.  */
 DEFTREECODE (SWITCH_STMT, "switch_stmt", 'e', 3)
 
-/* Used to represent an inline assembly statement.  */
-DEFTREECODE (ASM_STMT, "asm_stmt", 'e', 4)
-
 /* Used to represent a CASE_LABEL. The operands are CASE_LOW and
    CASE_HIGH, respectively. If CASE_LOW is NULL_TREE, the label is a
    'default' label. If CASE_HIGH is NULL_TREE, the label is a normal case
Index: gcc/c-common.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-common.h,v
retrieving revision 1.232
diff -c -p -d -u -r1.232 c-common.h
--- gcc/c-common.h	16 Jun 2004 18:21:12 -0000	1.232
+++ gcc/c-common.h	16 Jun 2004 20:13:05 -0000
@@ -30,7 +30,6 @@ Software Foundation, 59 Temple Place - S
    0: TREE_NEGATED_INT (in INTEGER_CST).
       IDENTIFIER_MARKED (used by search routines).
       DECL_PRETTY_FUNCTION_P (in VAR_DECL)
-      ASM_INPUT_P (in ASM_STMT)
       STMT_EXPR_NO_SCOPE (in STMT_EXPR)
    1: C_DECLARED_LABEL_FLAG (in LABEL_DECL)
       STMT_IS_FULL_EXPR_P (in _STMT)
@@ -1009,7 +1008,7 @@ enum c_tree_code {
    DECL_STMT,		IF_STMT,	FOR_STMT,	\
    WHILE_STMT,		DO_STMT,	RETURN_STMT,	\
    BREAK_STMT,		CONTINUE_STMT,			\
-   SWITCH_STMT,		ASM_STMT,	CASE_LABEL
+   SWITCH_STMT,		CASE_LABEL
 
 /* TRUE if a code represents a statement.  The front end init
    langhook should take care of initialization of this array.  */
Index: gcc/c-dump.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-dump.c,v
retrieving revision 1.20
diff -c -p -d -u -r1.20 c-dump.c
--- gcc/c-dump.c	16 Jun 2004 18:21:12 -0000	1.20
+++ gcc/c-dump.c	16 Jun 2004 20:13:05 -0000
@@ -63,17 +63,6 @@ c_dump_tree (void *dump_info, tree t)
 	dump_string (di, "bitfield");
       break;
 
-    case ASM_STMT:
-      dump_stmt (di, t);
-      if (ASM_VOLATILE_P (t))
-	dump_string (di, "volatile");
-      dump_child ("strg", ASM_STRING (t));
-      dump_child ("outs", ASM_OUTPUTS (t));
-      dump_child ("ins", ASM_INPUTS (t));
-      dump_child ("clbr", ASM_CLOBBERS (t));
-      dump_next_stmt (di, t);
-      break;
-
     case BREAK_STMT:
     case CONTINUE_STMT:
       dump_stmt (di, t);
Index: gcc/c-gimplify.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-gimplify.c,v
retrieving revision 2.6
diff -c -p -d -u -r2.6 c-gimplify.c
--- gcc/c-gimplify.c	16 Jun 2004 18:21:12 -0000	2.6
+++ gcc/c-gimplify.c	16 Jun 2004 20:13:05 -0000
@@ -283,18 +283,6 @@ c_gimplify_stmt (tree *stmt_p)
       ret = GS_OK;
       break;
 
-    case ASM_STMT:
-      {
-	tree new_stmt = build (ASM_EXPR, void_type_node, ASM_STRING (stmt),
-			       ASM_OUTPUTS (stmt), ASM_INPUTS (stmt),
-			       ASM_CLOBBERS (stmt));
-	ASM_INPUT_P (new_stmt) = ASM_INPUT_P (stmt);
-	ASM_VOLATILE_P (new_stmt) = ASM_VOLATILE_P (stmt);
-	stmt = new_stmt;
-	ret = GS_OK;
-      }
-      break;
-
     default:
       if (lang_gimplify_stmt && (*lang_gimplify_stmt) (&stmt))
 	{
Index: gcc/c-pretty-print.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-pretty-print.c,v
retrieving revision 1.44
diff -c -p -d -u -r1.44 c-pretty-print.c
--- gcc/c-pretty-print.c	16 Jun 2004 18:21:12 -0000	1.44
+++ gcc/c-pretty-print.c	16 Jun 2004 20:13:05 -0000
@@ -2117,37 +2117,6 @@ pp_c_statement (c_pretty_printer *pp, tr
       pp_needs_newline (pp) = true;
       break;
 
-    case ASM_STMT:
-      {
-	bool has_volatile_p = ASM_VOLATILE_P (stmt);
-	bool is_extended = has_volatile_p || ASM_INPUTS (stmt)
-	  || ASM_OUTPUTS (stmt) || ASM_CLOBBERS (stmt);
-	pp_c_identifier (pp, is_extended ? "__asm__" : "asm");
-	if (has_volatile_p)
-	  pp_c_identifier (pp, "__volatile__");
-	pp_space (pp);
-	pp_c_left_paren (pp);
-	pp_c_string_literal (pp, ASM_STRING (stmt));
-	if (is_extended)
-	  {
-	    pp_space (pp);
-	    pp_separate_with (pp, ':');
-	    if (ASM_OUTPUTS (stmt))
-	      pp_expression (pp, ASM_OUTPUTS (stmt));
-	    pp_space (pp);
-	    pp_separate_with (pp, ':');
-	    if (ASM_INPUTS (stmt))
-	      pp_expression (pp, ASM_INPUTS (stmt));
-	    pp_space (pp);
-	    pp_separate_with (pp, ':');
-	    if (ASM_CLOBBERS (stmt))
-	      pp_expression (pp, ASM_CLOBBERS (stmt));
-	  }
-	pp_c_right_paren (pp);
-	pp_newline (pp);
-      }
-      break;
-
     default:
       pp_unsupported_tree (pp, stmt);
     }
Index: gcc/c-typeck.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-typeck.c,v
retrieving revision 1.315
diff -c -p -d -u -r1.315 c-typeck.c
--- gcc/c-typeck.c	16 Jun 2004 01:21:21 -0000	1.315
+++ gcc/c-typeck.c	16 Jun 2004 20:13:06 -0000
@@ -6124,7 +6124,7 @@ process_init_element (tree value)
 
 /* Build a complete asm-statement, whose components are a CV_QUALIFIER
    (guaranteed to be 'volatile' or null) and ARGS (represented using
-   an ASM_STMT node).  */
+   an ASM_EXPR node).  */
 tree
 build_asm_stmt (tree cv_qualifier, tree args)
 {
@@ -6137,7 +6137,7 @@ build_asm_stmt (tree cv_qualifier, tree 
    some INPUTS, and some CLOBBERS.  The latter three may be NULL.
    SIMPLE indicates whether there was anything at all after the
    string in the asm expression -- asm("blah") and asm("blah" : )
-   are subtly different.  We use a ASM_STMT node to represent this.  */
+   are subtly different.  We use a ASM_EXPR node to represent this.  */
 tree
 build_asm_expr (tree string, tree outputs, tree inputs, tree clobbers,
 		bool simple)
@@ -6188,7 +6188,7 @@ build_asm_expr (tree string, tree output
   for (tail = inputs; tail; tail = TREE_CHAIN (tail))
     TREE_VALUE (tail) = default_function_array_conversion (TREE_VALUE (tail));
 
-  args = build_stmt (ASM_STMT, string, outputs, inputs, clobbers);
+  args = build_stmt (ASM_EXPR, string, outputs, inputs, clobbers);
 
   /* Simple asm statements are treated as volatile.  */
   if (simple)
Index: gcc/tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree.h,v
retrieving revision 1.515
diff -c -p -d -u -r1.515 tree.h
--- gcc/tree.h	16 Jun 2004 05:09:40 -0000	1.515
+++ gcc/tree.h	16 Jun 2004 20:13:06 -0000
@@ -1081,7 +1081,7 @@ struct tree_vec GTY(())
    a goto statement.  */
 #define GOTO_DESTINATION(NODE)  TREE_OPERAND ((NODE), 0)
 
-/* ASM_STMT accessors. ASM_STRING returns a STRING_CST for the
+/* ASM_EXPR accessors. ASM_STRING returns a STRING_CST for the
    instruction (e.g., "mov x, y"). ASM_OUTPUTS, ASM_INPUTS, and
    ASM_CLOBBERS represent the outputs, inputs, and clobbers for the
    statement.  */
Index: gcc/cp/parser.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/parser.c,v
retrieving revision 1.208
diff -c -p -d -u -r1.208 parser.c
--- gcc/cp/parser.c	16 Jun 2004 18:21:18 -0000	1.208
+++ gcc/cp/parser.c	16 Jun 2004 20:13:07 -0000
@@ -10035,12 +10035,12 @@ cp_parser_asm_definition (cp_parser* par
 					   /*consume_paren=*/true);
   cp_parser_require (parser, CPP_SEMICOLON, "`;'");
 
-  /* Create the ASM_STMT.  */
+  /* Create the ASM_EXPR.  */
   if (at_function_scope_p ())
     {
       asm_stmt = finish_asm_stmt (volatile_p, string, outputs,
 				  inputs, clobbers);
-      /* If the extended syntax was not used, mark the ASM_STMT.  */
+      /* If the extended syntax was not used, mark the ASM_EXPR.  */
       if (!extended_p)
 	ASM_INPUT_P (asm_stmt) = 1;
     }
Index: gcc/cp/pt.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/pt.c,v
retrieving revision 1.864
diff -c -p -d -u -r1.864 pt.c
--- gcc/cp/pt.c	16 Jun 2004 18:21:18 -0000	1.864
+++ gcc/cp/pt.c	16 Jun 2004 20:13:07 -0000
@@ -7997,7 +7997,7 @@ tsubst_expr (tree t, tree args, tsubst_f
       finish_goto_stmt (tmp);
       break;
 
-    case ASM_STMT:
+    case ASM_EXPR:
       prep_stmt (t);
       tmp = finish_asm_stmt
 	(ASM_VOLATILE_P (t),
Index: gcc/cp/semantics.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/semantics.c,v
retrieving revision 1.399
diff -c -p -d -u -r1.399 semantics.c
--- gcc/cp/semantics.c	16 Jun 2004 18:21:20 -0000	1.399
+++ gcc/cp/semantics.c	16 Jun 2004 20:13:07 -0000
@@ -1073,7 +1073,7 @@ finish_asm_stmt (int volatile_p, tree st
 	}
     }
 
-  r = build_stmt (ASM_STMT, string,
+  r = build_stmt (ASM_EXPR, string,
 		  output_operands, input_operands,
 		  clobbers);
   ASM_VOLATILE_P (r) = volatile_p;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]