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]

[tree-ssa] kill TREE_NOT_GIMPLE


All this "not gimple" stuff is working around a problem that does not
exist, and expect hasn't existed for quite some time.  Removing it
fixes the referenced PR, wherein MD builtins do need gimplification
in order to function properly.

Bootstrapped and tested on alphaev67 and i686-linux, both of which
have quite a few target builtins in the testsuite.


r~


        PR opt/13524
        * gengtype-yacc.y (struct_fields): Accept unnamed bitfields.
        (bitfieldlen): Split from ...
        (bitfieldopt): ... here.
        * gimplify.c (mark_not_gimple): Remove.
        (gimplify_call_expr): Don't ignore BUILT_IN_MD.
        * tree-dfa.c (struct walk_state): Remove is_not_gimple.
        (find_referenced_vars): Don't look for TREE_NOT_GIMPLE.
        (find_vars_r, add_referenced_var): Likewise.
        * tree-ssa-operands.c (get_stmt_operands, get_expr_operands): Likewise.
        * tree-simple.h (mark_not_gimple): Remove.
        * tree.h (struct tree_common): Remove not_gimple_flag.
        (TREE_NOT_GIMPLE): Remove.

Index: gengtype-yacc.y
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gengtype-yacc.y,v
retrieving revision 1.5.2.4
diff -c -p -d -r1.5.2.4 gengtype-yacc.y
*** gengtype-yacc.y	7 May 2003 13:28:05 -0000	1.5.2.4
--- gengtype-yacc.y	30 Jan 2004 07:41:10 -0000
*************** struct_fields: { $$ = NULL; }
*** 212,222 ****
  		    p->line = lexer_line;
  		    $$ = p;
  		  }
  	       ;
  
  bitfieldopt: /* empty */
! 	     | ':' NUM
! 	     | ':' ID
  	     ;
  
  type: SCALAR
--- 212,226 ----
  		    p->line = lexer_line;
  		    $$ = p;
  		  }
+ 	       | type ':' bitfieldlen ';' struct_fields
+ 		  { $$ = $5; }
  	       ;
  
  bitfieldopt: /* empty */
! 	     | ':' bitfieldlen
! 	     ;
! 
! bitfieldlen: NUM | ID
  	     ;
  
  type: SCALAR
Index: gimplify.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/gimplify.c,v
retrieving revision 1.1.2.139
diff -c -p -d -r1.1.2.139 gimplify.c
*** gimplify.c	28 Jan 2004 20:32:09 -0000	1.1.2.139
--- gimplify.c	30 Jan 2004 07:41:11 -0000
*************** unshare_expr (tree expr)
*** 663,674 ****
    return expr;
  }
  
- void
- mark_not_gimple (tree *expr_p)
- {
-   TREE_NOT_GIMPLE (*expr_p) = 1;
- }
- 
  /* A terser interface for building a representation of a exception
     specification.  */
  
--- 663,668 ----
*************** gimplify_call_expr (tree *expr_p, tree *
*** 1875,1893 ****
    if (decl && DECL_BUILT_IN (decl))
      {
        tree new;
- 
-       /* Some builtins cannot be gimplified because the require specific
- 	 arguments (e.g., MD builtins).  */
-       if (DECL_BUILT_IN_CLASS (decl) == BUILT_IN_MD
- 	  /* But we don't care if the call has no arguments.  */
- 	  && TREE_OPERAND (*expr_p, 1) != NULL_TREE)
- 	{
- 	  /* Mark the CALL_EXPR not gimplifiable so that optimizers don't
- 	     assume anything about it.  FIXME: Maybe we should add a target
- 	     hook for allowing this in the future?  */
- 	  mark_not_gimple (expr_p);
- 	  return GS_ALL_DONE;
- 	}
  
        /* If it is allocation of stack, record the need to restore the memory
  	 when the enclosing bind_expr is exited.  */
--- 1869,1874 ----
Index: tree-dfa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-dfa.c,v
retrieving revision 1.1.4.213
diff -c -p -d -r1.1.4.213 tree-dfa.c
*** tree-dfa.c	22 Jan 2004 23:51:29 -0000	1.1.4.213
--- tree-dfa.c	30 Jan 2004 07:41:11 -0000
*************** struct walk_state
*** 97,105 ****
    /* Nonzero if the walker is inside an ASM_EXPR node.  */
    int is_asm_expr : 1;
  
-   /* Nonzero if the walker is inside a non-GIMPLE expression.  */
-   int is_not_gimple : 1;
- 
    /* Hash table used to avoid adding the same variable more than once.  */
    htab_t vars_found;
  
--- 97,102 ----
*************** find_referenced_vars (void)
*** 201,232 ****
      for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
        {
  	tree *stmt_p = bsi_stmt_ptr (si);
- 
- 	/* Propagate non-GIMPLE attribute into the statement.  FIXME:
- 	   The only statements that are not in GIMPLE form are calls to MD
- 	   builtins.  Propagate the non-GIMPLE attribute from the RHS of
- 	   assignments into the statement, if needed.  */
- 	if (TREE_CODE (*stmt_p) == MODIFY_EXPR
- 	    && TREE_CODE (TREE_OPERAND (*stmt_p, 1)) == CALL_EXPR
- 	    && TREE_NOT_GIMPLE (TREE_OPERAND (*stmt_p, 1)))
- 	  mark_not_gimple (stmt_p);
- 
- 	/* A CALL_EXPR may also appear inside a RETURN_EXPR.  */
- 	if (TREE_CODE (*stmt_p) == RETURN_EXPR)
- 	  {
- 	    tree expr = TREE_OPERAND (*stmt_p, 0);
- 	    if (expr
- 		&& TREE_CODE (expr) == MODIFY_EXPR
- 		&& TREE_CODE (TREE_OPERAND (expr, 1)) == CALL_EXPR
- 		&& TREE_NOT_GIMPLE (TREE_OPERAND (expr, 1)))
- 	      mark_not_gimple (stmt_p);
- 	  }
- 
- 	if (TREE_NOT_GIMPLE (*stmt_p))
- 	  walk_state.is_not_gimple = 1;
- 
  	walk_tree (stmt_p, find_vars_r, &walk_state, NULL);
- 	walk_state.is_not_gimple = 0;
        }
  
    /* Determine whether to use .GLOBAL_VAR to model call clobber semantics.
--- 198,204 ----
*************** find_vars_r (tree *tp, int *walk_subtree
*** 1720,1730 ****
    tree t = *tp;
    struct walk_state *walk_state = (struct walk_state *)data;
  
- #if defined ENABLE_CHECKING
-   if (TREE_NOT_GIMPLE (*tp) && walk_state->is_not_gimple == 0)
-     abort ();
- #endif
- 
    /* Type and constant nodes have no interesting children.  Ignore them.  */
    if (TYPE_P (t) || TREE_CODE_CLASS (TREE_CODE (t)) == 'c')
      {
--- 1692,1697 ----
*************** find_vars_r (tree *tp, int *walk_subtree
*** 1801,1807 ****
    /* A function call that receives pointer arguments may dereference them.
       For every pointer 'p' in the argument to the function call, add a
       reference to '*p'.  */
!   if (TREE_CODE (t) == CALL_EXPR && walk_state->is_not_gimple == 0)
      {
        tree op;
  
--- 1768,1774 ----
    /* A function call that receives pointer arguments may dereference them.
       For every pointer 'p' in the argument to the function call, add a
       reference to '*p'.  */
!   if (TREE_CODE (t) == CALL_EXPR)
      {
        tree op;
  
*************** add_referenced_var (tree var, struct wal
*** 1901,1913 ****
       stores to keep track of.  */
    if (walk_state->is_store)
      v_ann->is_stored = 1;
- 
-   /* If VAR is being referenced inside a non-GIMPLE tree, mark it as having
-      hidden uses.  Currently, this is used for MD built-ins, which are not
-      gimplified and cannot be optimized.  FIXME: long term all trees must
-      be in GIMPLE form.  */
-   if (walk_state->is_not_gimple)
-     v_ann->has_hidden_use = 1;
  
    /* If the variable is a pointer being clobbered by an ASM_EXPR, the
       pointer may end up pointing to global memory.  */
--- 1868,1873 ----
Index: tree-simple.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-simple.h,v
retrieving revision 1.1.4.45
diff -c -p -d -r1.1.4.45 tree-simple.h
*** tree-simple.h	15 Dec 2003 15:55:34 -0000	1.1.4.45
--- tree-simple.h	30 Jan 2004 07:41:11 -0000
*************** void gimple_add_tmp_var (tree);
*** 115,121 ****
  tree gimple_current_bind_expr (void);
  void gimple_push_bind_expr (tree);
  void gimple_pop_bind_expr (void);
- void mark_not_gimple (tree *);
  void unshare_all_trees (tree);
  tree voidify_wrapper_expr (tree);
  tree gimple_build_eh_filter (tree, tree, tree);
--- 115,120 ----
Index: tree-ssa-operands.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-operands.c,v
retrieving revision 1.1.2.6
diff -c -p -d -r1.1.2.6 tree-ssa-operands.c
*** tree-ssa-operands.c	22 Jan 2004 01:58:13 -0000	1.1.2.6
--- tree-ssa-operands.c	30 Jan 2004 07:41:11 -0000
*************** get_stmt_operands (tree stmt)
*** 685,697 ****
       optimizers.  */
    ann->has_volatile_ops = false;
  
-   /* Non-GIMPLE statements are just marked unmodified.  */
-   if (TREE_NOT_GIMPLE (stmt))
-     {
-       ann->modified = 0;
-       return;
-     }
- 
    /* Remove any existing operands as they will be scanned again.  */
    free_defs (&(ann->def_ops), true);
    free_uses (&(ann->use_ops), true);
--- 685,690 ----
*************** get_expr_operands (tree stmt, tree *expr
*** 823,834 ****
  
    if (expr == NULL || expr == error_mark_node)
      return;
- 
- #if defined ENABLE_CHECKING
-   /* non-GIMPLE expressions should not appear here.  */
-   if (TREE_NOT_GIMPLE (expr))
-     abort ();
- #endif
  
    code = TREE_CODE (expr);
    class = TREE_CODE_CLASS (code);
--- 816,821 ----
Index: tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree.h,v
retrieving revision 1.342.2.163
diff -c -p -d -r1.342.2.163 tree.h
*** tree.h	28 Jan 2004 09:17:51 -0000	1.342.2.163
--- tree.h	30 Jan 2004 07:41:11 -0000
*************** struct tree_common GTY(())
*** 142,148 ****
    unsigned readonly_flag : 1;
    unsigned unsigned_flag : 1;
    unsigned asm_written_flag: 1;
!   unsigned not_gimple_flag : 1;
  
    unsigned used_flag : 1;
    unsigned nothrow_flag : 1;
--- 142,148 ----
    unsigned readonly_flag : 1;
    unsigned unsigned_flag : 1;
    unsigned asm_written_flag: 1;
!   unsigned : 1;
  
    unsigned used_flag : 1;
    unsigned nothrow_flag : 1;
*************** extern void tree_operand_check_failed (i
*** 728,736 ****
  /* Nonzero in an IDENTIFIER_NODE if the use of the name is defined as a
     deprecated feature by __attribute__((deprecated)).  */
  #define TREE_DEPRECATED(NODE) ((NODE)->common.deprecated_flag)
- 
- /* Nonzero if the node is not in GIMPLE form.  */
- #define TREE_NOT_GIMPLE(NODE) ((NODE)->common.not_gimple_flag)
  
  /* Value of expression is function invariant.  A strict subset of
     TREE_CONSTANT, such an expression is constant over any one function
--- 728,733 ----


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