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]

Re: patch for support profiling for AIX 4.3 (fwd)


Hi Richard,

Here is the patch after integrating the changes mentioned by you. Please 
let me know it is okay to apply.

Thanks
Chandra

2001-02-06  Chandrakala Chavva  <cchavva@redhat.com>

        * final.c: Revert back my previous changes.
        * output.h: Make profile_label_no extern.
        * config/rs6000/rs6000.c (output_profile_hook): Use standard functions
        for generating label.

Index: output.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/output.h,v
retrieving revision 1.54
diff -p -r1.54 output.h
*** output.h	2001/02/06 01:23:12	1.54
--- output.h	2001/02/06 20:46:06
*************** extern const char *user_label_prefix;
*** 459,462 ****
  #endif
  /* Assign unique numbers to labels generated for profiling.  */
  
! int profile_label_no;
--- 459,462 ----
  #endif
  /* Assign unique numbers to labels generated for profiling.  */
  
! extern int profile_label_no;
Index: final.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/final.c,v
retrieving revision 1.156
diff -p -r1.156 final.c
*** final.c	2001/02/06 01:23:12	1.156
--- final.c	2001/02/06 20:46:06
*************** char regs_ever_live[FIRST_PSEUDO_REGISTE
*** 205,210 ****
--- 205,214 ----
  
  int frame_pointer_needed;
  
+ /* Assign unique numbers to labels generated for profiling.  */
+ 
+ int profile_label_no;
+ 
  /* Number of unmatched NOTE_INSN_BLOCK_BEG notes we have seen.  */
  
  static int block_depth;
Index: config/rs6000/rs6000.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.164
diff -p -r1.164 rs6000.c
*** rs6000.c	2001/02/06 01:23:13	1.164
--- rs6000.c	2001/02/06 20:46:06
*************** void
*** 7086,7109 ****
  output_profile_hook (labelno)
       int labelno;
  {
! 
!    if (profile_flag && DEFAULT_ABI == ABI_AIX)
!      {
!        char *buf;
!        int length = 0;
!        rtx fun;
! 
!        labelno += 1;
!        buf = permalloc (labelno+6);
! 
!        ASM_GENERATE_INTERNAL_LABEL (buf, "LP", labelno);
! 
!        fun = gen_rtx_SYMBOL_REF (Pmode, buf+1);
! 
!        emit_library_call (init_one_libfunc (RS6000_MCOUNT), 0, VOIDmode, 1,
!                           fun, Pmode, Pmode);
! 
!       }
  }
  
  /* Write function profiler code. */
--- 7086,7106 ----
  output_profile_hook (labelno)
       int labelno;
  {
!   if (profile_flag && DEFAULT_ABI == ABI_AIX)
!     {
!       char buf[30];
!       char *label_name;
!       rtx fun;
! 
!       labelno += 1;
! 
!       ASM_GENERATE_INTERNAL_LABEL (buf, "LP", labelno);
!       STRIP_NAME_ENCODING (label_name, ggc_strdup(buf));
!       fun = gen_rtx_SYMBOL_REF (Pmode, label_name);
! 
!       emit_library_call (init_one_libfunc (RS6000_MCOUNT), 0, VOIDmode, 1,
!                          fun, Pmode);
!     }
  }
  
  /* Write function profiler code. */



On Mon, 5 Feb 2001, Richard Henderson wrote:

> On Mon, Feb 05, 2001 at 05:11:05PM -0800, Chandra Chavva wrote:
> > + output_profile_hook (labelno)
> > +      int labelno;
> > + {
> > + 
> 
> Extra space.
> 
> > +    if (profile_flag && DEFAULT_ABI == ABI_AIX)
> 
> Not indented properly.  The check for profile_flag is
> redundant with the use of PROFILE_HOOK.
> 
> > +      {
> > +        char *buf;
> > +        int length = 0;
> 
> This variable is unused.
> 
> > +        rtx fun;
> > + 
> > +        labelno += 1;
> > +        buf = permalloc (labelno+6);
> 
> We don't use permalloc anymore.  The size calculation
> is completely bogus.  Compute this into a local buffer
> and use ggc_strdup afterward.
> 
> > + 
> > +        ASM_GENERATE_INTERNAL_LABEL (buf, "LP", labelno);
> > + 
> > +        fun = gen_rtx_SYMBOL_REF (Pmode, buf+1);
> 
> Use STRIP_NAME_ENCODING instead of hardcoding a
> mysterious +1.
> 
> > + 
> > +        emit_library_call (init_one_libfunc (RS6000_MCOUNT), 0, VOIDmode, 1,
> > +                           fun, Pmode, Pmode);
> 
> Extra Pmode argument.
> 
> > + 
> > +       }
> 
> Extra space.
> 
> 
> 
> r~
> 

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