[PATCH][RFC] Do not error on inconsistent profiles (PR38977)

Richard Guenther rguenther@suse.de
Mon Jan 26 14:34:00 GMT 2009


It happens that some openSUSE packages do no longer build with GCC 4.4
as they error on inconsistent profiles.  In 4.3 this kind of
inconsistency was simply ignored, now we have the possibility to
"correct" them by smoothing - but this is not enabled by default, instead
we now error by default.

I suggest we revert to ignoring this kind of problem for 4.4 and
turn on profile smoothing by default for 4.5 (it is quite late for 4.4
now, and obviously this code-path has been not extensively tested).

Comments?

Thanks,
Richard.

2009-01-26  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/38977
	* profile.c (compute_branch_probabilities): Do not error on
	inconsistent profiles.

Index: gcc/profile.c
===================================================================
*** gcc/profile.c	(revision 143671)
--- gcc/profile.c	(working copy)
*************** compute_branch_probabilities (void)
*** 620,646 ****
    /* Check for inconsistent basic block counts */
    inconsistent = is_inconsistent ();
  
!   if (inconsistent)
!    {
!      if (flag_profile_correction)
!        {
!          /* Inconsistency detected. Make it flow-consistent. */
!          static int informed = 0;
!          if (informed == 0)
!            {
!              informed = 1;
!              inform (input_location, "correcting inconsistent profile data");
!            }
!          correct_negative_edge_counts ();
!          /* Set bb counts to the sum of the outgoing edge counts */
!          set_bb_counts ();
!          if (dump_file)
!            fprintf (dump_file, "\nCalling mcf_smooth_cfg\n");
!          mcf_smooth_cfg ();
!        }
!      else
!        error ("corrupted profile info: profile data is not flow-consistent");
!    }
  
    /* For every edge, calculate its branch probability and add a reg_note
       to the branch insn to indicate this.  */
--- 620,642 ----
    /* Check for inconsistent basic block counts */
    inconsistent = is_inconsistent ();
  
!   if (inconsistent
!       && flag_profile_correction)
!     {
!       /* Inconsistency detected. Make it flow-consistent. */
!       static int informed = 0;
!       if (informed == 0)
! 	{
! 	  informed = 1;
! 	  inform (input_location, "correcting inconsistent profile data");
! 	}
!       correct_negative_edge_counts ();
!       /* Set bb counts to the sum of the outgoing edge counts */
!       set_bb_counts ();
!       if (dump_file)
! 	fprintf (dump_file, "\nCalling mcf_smooth_cfg\n");
!       mcf_smooth_cfg ();
!     }
  
    /* For every edge, calculate its branch probability and add a reg_note
       to the branch insn to indicate this.  */



More information about the Gcc-patches mailing list