[tree-ssa] fix gcc.c-torture/execute/nestfunc-5.c

law@redhat.com law@redhat.com
Tue Jan 6 23:23:00 GMT 2004


In message <20040105221722.A20489@redhat.com>, Richard Henderson writes:
 >On Mon, Jan 05, 2004 at 10:12:13PM -0700, law@redhat.com wrote:
 >> Can we always get to the struct function in the cases where we care?
 >
 >I believe so.
Agreed.  Bootstrapped and regression tested on i686-pc-linux-gnu.


	* tree.h (FUNCTION_RECEIVES_NONLOCAL_GOTO): Kill.
	* tree-cfg.c (make_exit_edges, is_ctrl_altering_stmt):  Use
	current_function_has_nonlocal_label instead of
	FUNCTION_RECEIVES_NONLOCAL_GOTO.
	* gimplify.c (gimplify_expr): Set has_nonlocal_label in the
	appropriate function's struct function rather than setting
	a bit in the FUNCTION_DECL.



Index: gimplify.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/gimplify.c,v
retrieving revision 1.1.2.130
diff -c -p -r1.1.2.130 gimplify.c
*** gimplify.c	5 Jan 2004 22:33:06 -0000	1.1.2.130
--- gimplify.c	6 Jan 2004 23:16:28 -0000
*************** gimplify_expr (tree *expr_p, tree *pre_p
*** 3046,3052 ****
  		if (current_function_decl != context)
  		  {
  		    NONLOCAL_LABEL (dest) = 1;
! 		    FUNCTION_RECEIVES_NONLOCAL_GOTO (context) = 1;
  		  }
  	      }
  	    break;
--- 3046,3052 ----
  		if (current_function_decl != context)
  		  {
  		    NONLOCAL_LABEL (dest) = 1;
! 		    find_function_data (context)->has_nonlocal_label = 1;
  		  }
  	      }
  	    break;
Index: tree-cfg.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-cfg.c,v
retrieving revision 1.1.4.245
diff -c -p -r1.1.4.245 tree-cfg.c
*** tree-cfg.c	6 Jan 2004 01:21:12 -0000	1.1.4.245
--- tree-cfg.c	6 Jan 2004 23:16:35 -0000
*************** make_exit_edges (basic_block bb)
*** 528,534 ****
  	 make edges from this call site to all the nonlocal goto
  	 handlers.  */
        if (TREE_SIDE_EFFECTS (last)
! 	  && FUNCTION_RECEIVES_NONLOCAL_GOTO (current_function_decl))
  	make_goto_expr_edges (bb);
  
        /* If this statement has reachable exception handlers, then
--- 528,534 ----
  	 make edges from this call site to all the nonlocal goto
  	 handlers.  */
        if (TREE_SIDE_EFFECTS (last)
! 	  && current_function_has_nonlocal_label)
  	make_goto_expr_edges (bb);
  
        /* If this statement has reachable exception handlers, then
*************** make_exit_edges (basic_block bb)
*** 558,564 ****
  	 create any required edges.  */
        if (TREE_CODE (TREE_OPERAND (last, 1)) == CALL_EXPR
  	  && TREE_SIDE_EFFECTS (TREE_OPERAND (last, 1))
! 	  && FUNCTION_RECEIVES_NONLOCAL_GOTO (current_function_decl))
  	make_goto_expr_edges (bb);
  
        make_eh_edges (last);
--- 558,564 ----
  	 create any required edges.  */
        if (TREE_CODE (TREE_OPERAND (last, 1)) == CALL_EXPR
  	  && TREE_SIDE_EFFECTS (TREE_OPERAND (last, 1))
! 	  && current_function_has_nonlocal_label)
  	make_goto_expr_edges (bb);
  
        make_eh_edges (last);
*************** is_ctrl_altering_stmt (tree t)
*** 2087,2093 ****
        /* A non-pure/const CALL_EXPR alters flow control if the current function
           has nonlocal labels.  */
        if (TREE_SIDE_EFFECTS (t)
! 	  && FUNCTION_RECEIVES_NONLOCAL_GOTO (current_function_decl))
  	return true;
  
        /* A CALL_EXPR also alters flow control if it does not return.  */
--- 2087,2093 ----
        /* A non-pure/const CALL_EXPR alters flow control if the current function
           has nonlocal labels.  */
        if (TREE_SIDE_EFFECTS (t)
! 	  && current_function_has_nonlocal_label)
  	return true;
  
        /* A CALL_EXPR also alters flow control if it does not return.  */
Index: tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree.h,v
retrieving revision 1.342.2.156
diff -c -p -r1.342.2.156 tree.h
*** tree.h	3 Jan 2004 23:10:03 -0000	1.342.2.156
--- tree.h	6 Jan 2004 23:16:41 -0000
*************** struct tree_common GTY(())
*** 243,250 ****
             all expressions
         TYPE_READONLY in
             ..._TYPE
-        FUNCTION_RECEIVES_NONLOCAL_GOTO
- 	   FUNCTION_DECL
         NONLOCAL_LABEL in
  	   LABEL_DECL
  
--- 243,248 ----
*************** struct tree_common GTY(())
*** 259,266 ****
             INTEGER_TYPE, ENUMERAL_TYPE, FIELD_DECL
         SAVE_EXPR_NOPLACEHOLDER in
  	   SAVE_EXPR
-        FUNCTION_RECEIVES_NONLOCAL_GOTO in
- 	   FUNCTION_DECL
  
     asm_written_flag:
  
--- 257,262 ----
*************** extern void tree_operand_check_failed (i
*** 683,694 ****
  /* In INTEGER_TYPE or ENUMERAL_TYPE nodes, means an unsigned type.
     In FIELD_DECL nodes, means an unsigned bit field.  */
  #define TREE_UNSIGNED(NODE) ((NODE)->common.unsigned_flag)
- 
- /* In FUNCTION_DECL nodes, means that this function contains a label that is
-    a target of a non-local goto.  */
- /* ??? Why isn't this in struct function?  */
- #define FUNCTION_RECEIVES_NONLOCAL_GOTO(NODE) \
-   ((NODE)->common.unsigned_flag)
  
  #define TYPE_TRAP_SIGNED(NODE) \
    (flag_trapv && ! TREE_UNSIGNED (TYPE_CHECK (NODE)))
--- 679,684 ----




More information about the Gcc-patches mailing list