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] cleanup creation of artificial labels


Hi,

Another trivial cleanup: There were lots of places where we needed to
build a new label, and in all those places the code looks like,

  tree label = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE);
  DECL_CONTEXT (label) = current_function_decl;
  DECL_ARTIFICIAL (label) = 1;

I've just moved this into a new function.  Also turns out that there are
many places where we'd create an artificial label, but would not set
DECL_ARTIFICIAL.  I believe we should, and this patch makes it so.

Bootstrapped on i686-pc-linux-gnu, testing in progress and looking good,
of course.  OK assuming it finishes with no new regressions?

Gr.
Steven

	* gimplify.c (create_artificial_label): New function.
	(build_and_jump): Use it.
	* c-simplify.c (c_gimplify_stmt): Likewise.
	(gimplify_condition): Likewise.
	* tree-cfg.c (factor_computed_gotos, tree_block_forwards_to,
	handle_switch_fallthru, handle_switch_split): Likewise.
	* tree-ssa-dom.c (thread_edge): Likewise.
	* tree-ssa-pre.c (split_critical_edges): Likewise.
	* tree-tailcall.c (eliminate_tail_call): Likewise.
	* tree-eh.c (frob_into_branch_around,
	honor_protect_cleanup_actions, lower_try_finally_nofallthru,
	lower_try_finally_onedest, lower_try_finally_copy,
	lower_try_finally_switch, lower_catch, lower_eh_filter,
	lower_cleanup): Likewise.
	(make_label): Remove.
	* tree-simple.h (create_artificial_label): Add prototype.
	* tree-inline.c (expand_call_inline): Make return label for
	inlined function artificial.

Index: c-simplify.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/c-simplify.c,v
retrieving revision 1.1.4.75
diff -c -3 -p -r1.1.4.75 c-simplify.c
*** c-simplify.c	23 Oct 2003 16:45:51 -0000	1.1.4.75
--- c-simplify.c	23 Oct 2003 21:53:55 -0000
*************** c_gimplify_stmt (tree *stmt_p)
*** 254,261 ****
  
  	case CASE_LABEL:
  	  {
! 	    tree label = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE);
! 	    DECL_CONTEXT (label) = current_function_decl;
  	    stmt = build (CASE_LABEL_EXPR, void_type_node,
  			  CASE_LOW (stmt), CASE_HIGH (stmt), label);
  	  }
--- 254,260 ----
  
  	case CASE_LABEL:
  	  {
! 	    tree label = create_artificial_label ();
  	    stmt = build (CASE_LABEL_EXPR, void_type_node,
  			  CASE_LOW (stmt), CASE_HIGH (stmt), label);
  	  }
*************** gimplify_condition (tree *cond_p)
*** 522,530 ****
  static tree
  begin_bc_block (enum bc_t bc)
  {
!   tree label = build_decl (LABEL_DECL, ctxp->bc_id[bc], NULL_TREE);
!   DECL_ARTIFICIAL (label) = 1;
!   DECL_CONTEXT (label) = current_function_decl;
    TREE_CHAIN (label) = ctxp->current_bc_label;
    ctxp->current_bc_label = label;
    return label;
--- 521,528 ----
  static tree
  begin_bc_block (enum bc_t bc)
  {
!   tree label = create_artificial_label ();
!   DECL_NAME (label) = ctxp->bc_id[bc];
    TREE_CHAIN (label) = ctxp->current_bc_label;
    ctxp->current_bc_label = label;
    return label;
Index: gimplify.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/gimplify.c,v
retrieving revision 1.1.2.101
diff -c -3 -p -r1.1.2.101 gimplify.c
*** gimplify.c	23 Oct 2003 16:45:51 -0000	1.1.2.101
--- gimplify.c	23 Oct 2003 21:54:27 -0000
*************** remove_suffix (char *name, int len)
*** 226,231 ****
--- 226,243 ----
      }
  }
  
+ /* Create a nameless artificial label and put it in the current function
+    context.  Returns the newly created label.  */
+ 
+ tree
+ create_artificial_label (void)
+ {
+   tree lab = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE);
+   DECL_ARTIFICIAL (lab) = 1;
+   DECL_CONTEXT (lab) = current_function_decl;
+   return lab;
+ }
+ 
  /*  Create a new temporary variable declaration of type TYPE.  Returns the
      newly created decl and pushes it into the current binding.  */
  
*************** build_and_jump (tree *label_p)
*** 990,998 ****
  
    if (*label_p == NULL_TREE)
      {
!       tree label = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE);
!       DECL_ARTIFICIAL (label) = 1;
!       DECL_CONTEXT (label) = current_function_decl;
        *label_p = label;
      }
  
--- 1002,1008 ----
  
    if (*label_p == NULL_TREE)
      {
!       tree label = create_artificial_label ();
        *label_p = label;
      }
  
Index: tree-cfg.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-cfg.c,v
retrieving revision 1.1.4.182
diff -c -3 -p -r1.1.4.182 tree-cfg.c
*** tree-cfg.c	23 Oct 2003 00:35:22 -0000	1.1.4.182
--- tree-cfg.c	23 Oct 2003 21:54:37 -0000
*************** factor_computed_gotos ()
*** 377,385 ****
  
  	      /* Build a label for the new block which will contain the
  		 factored computed goto.  */
! 	      factored_label_decl
! 		= build_decl (LABEL_DECL, NULL_TREE, NULL_TREE);
! 	      DECL_CONTEXT (factored_label_decl) = current_function_decl;
  	      factored_computed_goto_label
  		= build1 (LABEL_EXPR, void_type_node, factored_label_decl);
  	      modify_stmt (factored_computed_goto_label);
--- 377,383 ----
  
  	      /* Build a label for the new block which will contain the
  		 factored computed goto.  */
! 	      factored_label_decl = create_artificial_label ();
  	      factored_computed_goto_label
  		= build1 (LABEL_EXPR, void_type_node, factored_label_decl);
  	      modify_stmt (factored_computed_goto_label);
*************** tree_block_forwards_to (basic_block bb)
*** 2219,2226 ****
  	  if (TREE_CODE (stmt) != LABEL_EXPR)
  	    {
  	      /* DEST does not start with a label, add one.  */
! 	      stmt = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE);
! 	      DECL_CONTEXT (stmt) = current_function_decl;
  	      stmt = build1 (LABEL_EXPR, void_type_node, stmt);
  	      bsi_insert_before (&bsi, stmt, BSI_NEW_STMT);
  	    }
--- 2217,2223 ----
  	  if (TREE_CODE (stmt) != LABEL_EXPR)
  	    {
  	      /* DEST does not start with a label, add one.  */
! 	      stmt = create_artificial_label ();
  	      stmt = build1 (LABEL_EXPR, void_type_node, stmt);
  	      bsi_insert_before (&bsi, stmt, BSI_NEW_STMT);
  	    }
*************** handle_switch_fallthru (tree sw_stmt, ba
*** 3939,3946 ****
    if (TREE_CODE (stmt) != LABEL_EXPR)
      {
        /* DEST does not start with a label, add one.  */
!       label = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE);
!       DECL_CONTEXT (label) = current_function_decl;
        stmt = build1 (LABEL_EXPR, void_type_node, label);
        bsi_insert_before (&bsi, stmt, BSI_NEW_STMT);
      }
--- 3936,3942 ----
    if (TREE_CODE (stmt) != LABEL_EXPR)
      {
        /* DEST does not start with a label, add one.  */
!       label = create_artificial_label ();
        stmt = build1 (LABEL_EXPR, void_type_node, label);
        bsi_insert_before (&bsi, stmt, BSI_NEW_STMT);
      }
*************** handle_switch_fallthru (tree sw_stmt, ba
*** 3988,3995 ****
      }
  
    tsi = tsi_last (&BIND_EXPR_BODY (SWITCH_BODY (sw_stmt)));
!   label = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE);
!   DECL_CONTEXT (label) = current_function_decl;
    stmt = build (CASE_LABEL_EXPR, void_type_node, NULL_TREE, NULL_TREE, label);
  
    /* Update block in the new CE node.  */
--- 3984,3990 ----
      }
  
    tsi = tsi_last (&BIND_EXPR_BODY (SWITCH_BODY (sw_stmt)));
!   label = create_artificial_label ();
    stmt = build (CASE_LABEL_EXPR, void_type_node, NULL_TREE, NULL_TREE, label);
  
    /* Update block in the new CE node.  */
*************** handle_switch_split (basic_block src, ba
*** 4053,4060 ****
       point.  */
    src->succ->flags |= EDGE_FALLTHRU;
  
!   label = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE);
!   DECL_CONTEXT (label) = current_function_decl;
    TREE_USED (label) = 1;
  
    /* Insert a goto on all edges except the one from src to this label. */
--- 4048,4054 ----
       point.  */
    src->succ->flags |= EDGE_FALLTHRU;
  
!   label = create_artificial_label ();
    TREE_USED (label) = 1;
  
    /* Insert a goto on all edges except the one from src to this label. */
Index: tree-eh.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-eh.c,v
retrieving revision 1.1.2.6
diff -c -3 -p -r1.1.2.6 tree-eh.c
*** tree-eh.c	18 Oct 2003 03:09:47 -0000	1.1.2.6
--- tree-eh.c	23 Oct 2003 21:54:39 -0000
*************** extern int using_eh_for_cleanups_p;
*** 40,56 ****
  
  /* Misc functions used in this file.  */
  
- /* Create a new LABEL_DECL.  */
- /* ??? Should be moved somewhere generic; possibly tree.c.  */
- 
- static tree
- make_label (void)
- {
-   tree lab = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE);
-   DECL_CONTEXT (lab) = current_function_decl;
-   return lab;
- }
- 
  /* Compare and hash for any structure which begins with a canonical
     pointer.  Assumes all pointers are interchangable, which is sort
     of already assumed by gcc elsewhere IIRC.  */
--- 40,45 ----
*************** frob_into_branch_around (tree *tp, tree 
*** 621,627 ****
    if (block_may_fallthru_last (tsi_stmt (i)))
      {
        if (!over)
! 	over = make_label ();
        x = build1 (GOTO_EXPR, void_type_node, over);
        tsi_link_after (&i, x, TSI_NEW_STMT);
      }
--- 610,616 ----
    if (block_may_fallthru_last (tsi_stmt (i)))
      {
        if (!over)
! 	over = create_artificial_label ();
        x = build1 (GOTO_EXPR, void_type_node, over);
        tsi_link_after (&i, x, TSI_NEW_STMT);
      }
*************** honor_protect_cleanup_actions (struct le
*** 779,785 ****
    if (tf->may_fallthru)
      {
        if (!tf->fallthru_label)
! 	tf->fallthru_label = make_label ();
        x = build1 (GOTO_EXPR, void_type_node, tf->fallthru_label);
        tsi_link_after (&i, x, TSI_NEW_STMT);
  
--- 768,774 ----
    if (tf->may_fallthru)
      {
        if (!tf->fallthru_label)
! 	tf->fallthru_label = create_artificial_label ();
        x = build1 (GOTO_EXPR, void_type_node, tf->fallthru_label);
        tsi_link_after (&i, x, TSI_NEW_STMT);
  
*************** lower_try_finally_nofallthru (struct leh
*** 814,820 ****
    if (tf->may_throw)
      lab = tf->eh_label;
    else
!     lab = make_label ();
  
    finally = TREE_OPERAND (*tf->top_p, 1);
    *tf->top_p = TREE_OPERAND (*tf->top_p, 0);
--- 803,809 ----
    if (tf->may_throw)
      lab = tf->eh_label;
    else
!     lab = create_artificial_label ();
  
    finally = TREE_OPERAND (*tf->top_p, 1);
    *tf->top_p = TREE_OPERAND (*tf->top_p, 0);
*************** lower_try_finally_onedest (struct leh_st
*** 880,886 ****
        return;
      }
  
!   finally_label = make_label ();
    x = build1 (LABEL_EXPR, void_type_node, finally_label);
    tsi_link_after (&i, x, TSI_NEW_STMT);
  
--- 869,875 ----
        return;
      }
  
!   finally_label = create_artificial_label ();
    x = build1 (LABEL_EXPR, void_type_node, finally_label);
    tsi_link_after (&i, x, TSI_NEW_STMT);
  
*************** lower_try_finally_copy (struct leh_state
*** 942,948 ****
        tsi_link_chain_after (&i, x, TSI_CHAIN_END);
  
        if (!tf->fallthru_label)
! 	tf->fallthru_label = make_label ();
        x = build1 (GOTO_EXPR, void_type_node, tf->fallthru_label);
        tsi_link_after (&i, x, TSI_NEW_STMT);
      }
--- 931,937 ----
        tsi_link_chain_after (&i, x, TSI_CHAIN_END);
  
        if (!tf->fallthru_label)
! 	tf->fallthru_label = create_artificial_label ();
        x = build1 (GOTO_EXPR, void_type_node, tf->fallthru_label);
        tsi_link_after (&i, x, TSI_NEW_STMT);
      }
*************** lower_try_finally_copy (struct leh_state
*** 984,990 ****
  
  	  if (!lab)
  	    {
! 	      labels[index] = lab = make_label ();
  	      build_p = true;
  	    }
  
--- 973,979 ----
  
  	  if (!lab)
  	    {
! 	      labels[index] = lab = create_artificial_label ();
  	      build_p = true;
  	    }
  
*************** lower_try_finally_switch (struct leh_sta
*** 1052,1058 ****
    ndests = fallthru_index + tf->may_fallthru;
  
    finally_tmp = create_tmp_var (integer_type_node, "finally_tmp");
!   finally_label = make_label ();
  
    case_label_vec = make_tree_vec (ndests);
    switch_stmt = build (SWITCH_EXPR, integer_type_node, finally_tmp,
--- 1041,1047 ----
    ndests = fallthru_index + tf->may_fallthru;
  
    finally_tmp = create_tmp_var (integer_type_node, "finally_tmp");
!   finally_label = create_artificial_label ();
  
    case_label_vec = make_tree_vec (ndests);
    switch_stmt = build (SWITCH_EXPR, integer_type_node, finally_tmp,
*************** lower_try_finally_switch (struct leh_sta
*** 1078,1087 ****
  	}
  
        if (!tf->fallthru_label)
! 	tf->fallthru_label = make_label ();
  
        last_case = build (CASE_LABEL_EXPR, void_type_node,
! 			 build_int_2 (fallthru_index, 0), NULL, make_label ());
        TREE_VEC_ELT (case_label_vec, last_case_index) = last_case;
        last_case_index++;
  
--- 1067,1077 ----
  	}
  
        if (!tf->fallthru_label)
! 	tf->fallthru_label = create_artificial_label ();
  
        last_case = build (CASE_LABEL_EXPR, void_type_node,
! 			 build_int_2 (fallthru_index, 0), NULL,
! 			 create_artificial_label ());
        TREE_VEC_ELT (case_label_vec, last_case_index) = last_case;
        last_case_index++;
  
*************** lower_try_finally_switch (struct leh_sta
*** 1100,1106 ****
        tsi_link_after (&i, x, TSI_NEW_STMT);
  
        last_case = build (CASE_LABEL_EXPR, void_type_node,
! 			 build_int_2 (eh_index, 0), NULL, make_label ());
        TREE_VEC_ELT (case_label_vec, last_case_index) = last_case;
        last_case_index++;
  
--- 1090,1097 ----
        tsi_link_after (&i, x, TSI_NEW_STMT);
  
        last_case = build (CASE_LABEL_EXPR, void_type_node,
! 			 build_int_2 (eh_index, 0), NULL,
! 			 create_artificial_label ());
        TREE_VEC_ELT (case_label_vec, last_case_index) = last_case;
        last_case_index++;
  
*************** lower_try_finally_switch (struct leh_sta
*** 1144,1150 ****
        if (!TREE_VEC_ELT (case_label_vec, case_index))
  	{
  	  last_case = build (CASE_LABEL_EXPR, void_type_node,
! 			     build_int_2 (switch_id, 0), NULL, make_label ());
  	  TREE_VEC_ELT (case_label_vec, case_index) = last_case;
  
  	  tsi_link_after (&i2, last_case, TSI_NEW_STMT);
--- 1135,1142 ----
        if (!TREE_VEC_ELT (case_label_vec, case_index))
  	{
  	  last_case = build (CASE_LABEL_EXPR, void_type_node,
! 			     build_int_2 (switch_id, 0), NULL,
! 			     create_artificial_label ());
  	  TREE_VEC_ELT (case_label_vec, case_index) = last_case;
  
  	  tsi_link_after (&i2, last_case, TSI_NEW_STMT);
*************** lower_try_finally (struct leh_state *sta
*** 1240,1246 ****
      this_tf.may_throw = get_eh_region_may_contain_throw (this_tf.region);
    if (this_tf.may_throw)
      {
!       this_tf.eh_label = make_label ();
        set_eh_region_tree_label (this_tf.region, this_tf.eh_label);
        honor_protect_cleanup_actions (state, &this_state, &this_tf);
      }
--- 1232,1238 ----
      this_tf.may_throw = get_eh_region_may_contain_throw (this_tf.region);
    if (this_tf.may_throw)
      {
!       this_tf.eh_label = create_artificial_label ();
        set_eh_region_tree_label (this_tf.region, this_tf.eh_label);
        honor_protect_cleanup_actions (state, &this_state, &this_tf);
      }
*************** lower_catch (struct leh_state *state, tr
*** 1331,1337 ****
  
        lower_eh_constructs_1 (state, &CATCH_BODY (catch));
  
!       eh_label = make_label ();
        set_eh_region_tree_label (catch_region, eh_label);
  
        j = tsi_start (&CATCH_BODY (catch));
--- 1323,1329 ----
  
        lower_eh_constructs_1 (state, &CATCH_BODY (catch));
  
!       eh_label = create_artificial_label ();
        set_eh_region_tree_label (catch_region, eh_label);
  
        j = tsi_start (&CATCH_BODY (catch));
*************** lower_catch (struct leh_state *state, tr
*** 1341,1347 ****
        if (block_may_fallthru (&CATCH_BODY (catch)))
  	{
  	  if (!out_label)
! 	    out_label = make_label ();
  
  	  j = tsi_last (&CATCH_BODY (catch));
  	  x = build1 (GOTO_EXPR, void_type_node, out_label);
--- 1333,1339 ----
        if (block_may_fallthru (&CATCH_BODY (catch)))
  	{
  	  if (!out_label)
! 	    out_label = create_artificial_label ();
  
  	  j = tsi_last (&CATCH_BODY (catch));
  	  x = build1 (GOTO_EXPR, void_type_node, out_label);
*************** lower_eh_filter (struct leh_state *state
*** 1386,1392 ****
    lower_eh_constructs_1 (state, &EH_FILTER_FAILURE (inner));
    TREE_OPERAND (*tp, 1) = EH_FILTER_FAILURE (inner);
  
!   eh_label = make_label ();
    set_eh_region_tree_label (this_region, eh_label);
  
    frob_into_branch_around (tp, eh_label, NULL);
--- 1378,1384 ----
    lower_eh_constructs_1 (state, &EH_FILTER_FAILURE (inner));
    TREE_OPERAND (*tp, 1) = EH_FILTER_FAILURE (inner);
  
!   eh_label = create_artificial_label ();
    set_eh_region_tree_label (this_region, eh_label);
  
    frob_into_branch_around (tp, eh_label, NULL);
*************** lower_cleanup (struct leh_state *state, 
*** 1430,1436 ****
    fake_tf.may_fallthru = block_may_fallthru (&TREE_OPERAND (*tp, 0));
    fake_tf.may_throw = true;
  
!   fake_tf.eh_label = make_label ();
    set_eh_region_tree_label (this_region, fake_tf.eh_label);
  
    honor_protect_cleanup_actions (state, NULL, &fake_tf);
--- 1422,1428 ----
    fake_tf.may_fallthru = block_may_fallthru (&TREE_OPERAND (*tp, 0));
    fake_tf.may_throw = true;
  
!   fake_tf.eh_label = create_artificial_label ();
    set_eh_region_tree_label (this_region, fake_tf.eh_label);
  
    honor_protect_cleanup_actions (state, NULL, &fake_tf);
Index: tree-simple.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-simple.h,v
retrieving revision 1.1.4.36
diff -c -3 -p -r1.1.4.36 tree-simple.h
*** tree-simple.h	23 Oct 2003 16:45:52 -0000	1.1.4.36
--- tree-simple.h	23 Oct 2003 21:54:43 -0000
*************** Boston, MA 02111-1307, USA.  */
*** 25,30 ****
--- 25,31 ----
  
  #include "tree-iterator.h"
  
+ extern tree create_artificial_label (void);
  extern tree create_tmp_var (tree, const char *);
  extern tree create_tmp_alias_var (tree, const char *);
  extern bool is_gimple_tmp_var (tree);
Index: tree-ssa-dom.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-dom.c,v
retrieving revision 1.1.2.64
diff -c -3 -p -r1.1.2.64 tree-ssa-dom.c
*** tree-ssa-dom.c	22 Oct 2003 19:38:52 -0000	1.1.2.64
--- tree-ssa-dom.c	23 Oct 2003 21:54:48 -0000
*************** thread_edge (edge e, basic_block dest)
*** 399,406 ****
    if (!dest_stmt
        || TREE_CODE (dest_stmt) != LABEL_EXPR)
      {
!       label = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE);
!       DECL_CONTEXT (label) = current_function_decl;
        dest_stmt = build1 (LABEL_EXPR, void_type_node, label);
        bsi_insert_before (&dest_iterator, dest_stmt, BSI_NEW_STMT);
      }
--- 399,405 ----
    if (!dest_stmt
        || TREE_CODE (dest_stmt) != LABEL_EXPR)
      {
!       label = create_artificial_label ();
        dest_stmt = build1 (LABEL_EXPR, void_type_node, label);
        bsi_insert_before (&dest_iterator, dest_stmt, BSI_NEW_STMT);
      }
Index: tree-ssa-pre.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-pre.c,v
retrieving revision 1.1.4.92
diff -c -3 -p -r1.1.4.92 tree-ssa-pre.c
*** tree-ssa-pre.c	21 Oct 2003 18:47:18 -0000	1.1.4.92
--- tree-ssa-pre.c	23 Oct 2003 21:54:53 -0000
*************** split_critical_edges (void)
*** 2909,2918 ****
      if (EDGE_CRITICAL_P (e) && !(e->flags & EDGE_ABNORMAL))
        {
  	tree label = build1 (LABEL_EXPR, void_type_node, NULL_TREE);
! 	LABEL_EXPR_LABEL (label) = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE);
! 	DECL_ARTIFICIAL (LABEL_EXPR_LABEL (label)) = 1;
! 	DECL_CONTEXT (LABEL_EXPR_LABEL (label)) = current_function_decl;
! 
  	bsi_insert_on_edge (e, label);
        }
    }
--- 2909,2915 ----
      if (EDGE_CRITICAL_P (e) && !(e->flags & EDGE_ABNORMAL))
        {
  	tree label = build1 (LABEL_EXPR, void_type_node, NULL_TREE);
! 	LABEL_EXPR_LABEL (label) = create_artificial_label ();
  	bsi_insert_on_edge (e, label);
        }
    }
Index: tree-tailcall.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-tailcall.c,v
retrieving revision 1.1.2.2
diff -c -3 -p -r1.1.2.2 tree-tailcall.c
*** tree-tailcall.c	21 Oct 2003 14:35:48 -0000	1.1.2.2
--- tree-tailcall.c	23 Oct 2003 21:54:53 -0000
*************** eliminate_tail_call (block_stmt_iterator
*** 192,200 ****
    bsi_s = bsi_start (ENTRY_BLOCK_PTR->succ->dest);
    if (bsi_end_p (bsi_s) || TREE_CODE (bsi_stmt (bsi_s)) != LABEL_EXPR)
      {
!       label = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE);
!       DECL_ARTIFICIAL (label) = 1;
!       DECL_CONTEXT (label) = current_function_decl;
        emit_label = true;
      }
    else
--- 192,198 ----
    bsi_s = bsi_start (ENTRY_BLOCK_PTR->succ->dest);
    if (bsi_end_p (bsi_s) || TREE_CODE (bsi_stmt (bsi_s)) != LABEL_EXPR)
      {
!       label = create_artificial_label ();
        emit_label = true;
      }
    else
Index: tree-inline.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-inline.c,v
retrieving revision 1.26.2.51
diff -c -3 -p -r1.26.2.51 tree-inline.c
*** tree-inline.c	6 Oct 2003 17:36:42 -0000	1.26.2.51
--- tree-inline.c	23 Oct 2003 22:06:09 -0000
*************** expand_call_inline (tree *tp, int *walk_
*** 1361,1366 ****
--- 1361,1367 ----
    /* Return statements in the function body will be replaced by jumps
       to the RET_LABEL.  */
    id->ret_label = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE);
+   DECL_ARTIFICIAL (id->ret_label) = 1;
    DECL_CONTEXT (id->ret_label) = VARRAY_TREE (id->fns, 0);
  
    if (! DECL_INITIAL (fn)

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