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]

Fix profile.c failures


Hi,
this fixes the profile.c part. (see previous patch for explanation)

Regtested/bootstrapped i686 together with other weekend work
Also sanity checked by profile feedbacked compilation of specint2000 tests.

Mon Jul 30 12:45:59 CEST 2001  Jan Hubicka  <jh@suse.cz>

	* profile.c (branch_prob): Call flow_call_edges_add instead of
	doing that by hand; cleanup cfg to re-merge basic blocks once
	we are done.
	
Index: profile.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/profile.c,v
retrieving revision 1.58
diff -c -3 -p -r1.58 profile.c
*** profile.c	2001/07/11 17:36:50	1.58
--- profile.c	2001/07/30 10:45:11
*************** branch_prob ()
*** 550,555 ****
--- 533,540 ----
  
    total_num_times_called++;
  
+   flow_call_edges_add (NULL);
+ 
    /* We can't handle cyclic regions constructed using abnormal edges.
       To avoid these we replace every source of abnormal edge by a fake
       edge from entry node and every destination by fake edge to exit.
*************** branch_prob ()
*** 584,611 ****
  	    have_entry_edge = 1;
  	}
  
-       /* ??? Not strictly needed unless flag_test_coverage, but adding
- 	 them anyway keeps the .da file consistent.  */
-       /* ??? Currently inexact for basic blocks with multiple calls. 
- 	 We need to split blocks here.  */
-       for (insn = bb->head;
- 	   insn != NEXT_INSN (bb->end);
- 	   insn = NEXT_INSN (insn))
- 	{
- 	  rtx set;
- 	  if (GET_CODE (insn) == CALL_INSN && !CONST_CALL_P (insn))
- 	    need_exit_edge = 1;
- 	  else if (GET_CODE (insn) == INSN)
- 	    {
- 	      set = PATTERN (insn);
- 	      if (GET_CODE (set) == PARALLEL)
- 		set = XVECEXP (set, 0, 0);
- 	      if ((GET_CODE (set) == ASM_OPERANDS && MEM_VOLATILE_P (set))
- 		  || GET_CODE (set) == ASM_INPUT)
- 		need_exit_edge = 1;
- 	    }
- 	}
- 
        if (need_exit_edge && !have_exit_edge)
  	{
  	  if (rtl_dump_file)
--- 569,574 ----
*************** branch_prob ()
*** 809,814 ****
--- 774,785 ----
      }
  
    remove_fake_edges ();
+   /* Get rid of splitted basic blocks and mess introduced by the edge
+      splitting.  */
+   cleanup_cfg (profile_arc_flag ? CLEANUP_EXPENSIVE : 0);
+   if (rtl_dump_file)
+     dump_flow_info (rtl_dump_file);
+ 
    free (edge_infos);
    free_edge_list (el);
  }


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