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]

Re: CFT: ppc opt support


On Fri, May 06, 2005 at 12:01:26AM -0400, David Edelsohn wrote:
> Aldy,
> 
> 	Why are
> 
> #define MASK_PROFILE_KERNEL     0x00400000
> #define TARGET_PROFILE_KERNEL   (target_flags & MASK_PROFILE_KERNEL)
> 
> defined in linux64.h after your patch?

Bug bug bug.  Thanks for spotting this.

The patch below fixes this.  I tested it by making cc1 for ppc64-linux.

I moved the comment to output_profile_hook, so we don't lose it.

OK?

	* config/rs6000/linux64.h: Remove MASK_PROFILE_KERNEL, and
	TARGET_PROFILE_KERNEL.

	* config/rs6000/rs6000.c (output_profile_hook): Add comment to
	TARGET_PROFILE_KERNEL use.

Index: config/rs6000/linux64.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/linux64.h,v
retrieving revision 1.76
diff -c -p -r1.76 linux64.h
*** config/rs6000/linux64.h	5 May 2005 20:54:21 -0000	1.76
--- config/rs6000/linux64.h	6 May 2005 10:53:04 -0000
*************** extern int dot_symbols;
*** 206,219 ****
  
  #endif
  
- #define	MASK_PROFILE_KERNEL	0x00100000
- 
- /* Non-standard profiling for kernels, which just saves LR then calls
-    _mcount without worrying about arg saves.  The idea is to change
-    the function prologue as little as possible as it isn't easy to
-    account for arg save/restore code added just for _mcount.  */
- #define TARGET_PROFILE_KERNEL	(target_flags & MASK_PROFILE_KERNEL)
- 
  /* We use glibc _mcount for profiling.  */
  #define NO_PROFILE_COUNTERS TARGET_64BIT
  #define PROFILE_HOOK(LABEL) \
--- 206,211 ----
Index: config/rs6000/rs6000.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.820
diff -c -p -r1.820 rs6000.c
*** config/rs6000/rs6000.c	5 May 2005 20:54:22 -0000	1.820
--- config/rs6000/rs6000.c	6 May 2005 10:53:12 -0000
*************** rs6000_gen_section_name (char **buf, con
*** 15233,15238 ****
--- 15233,15242 ----
  void
  output_profile_hook (int labelno ATTRIBUTE_UNUSED)
  {
+   /* Non-standard profiling for kernels, which just saves LR then calls
+      _mcount without worrying about arg saves.  The idea is to change
+      the function prologue as little as possible as it isn't easy to
+      account for arg save/restore code added just for _mcount.  */
    if (TARGET_PROFILE_KERNEL)
      return;
  


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