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]

SH PIC: (not) disabling function CSE


Function CSE had to be disabled on SH -fPIC because function call
sequences use constants relative to the address of the caller.
However, disabling function cSE is not necessary for non-PIC code, and
this is a highly beneficial optimization for SH code.  Here's the
patch.  Ok to install?

Index: gcc/ChangeLog

	* config/sh/sh.h (OVERRIDE_OPTIONS): Don't disable function
	CSE unless generating PIC.

Index: gcc/config/sh/sh.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/sh/sh.h,v
retrieving revision 1.69
diff -u -p -r1.69 sh.h
--- gcc/config/sh/sh.h 2000/09/06 09:20:38 1.69
+++ gcc/config/sh/sh.h 2000/09/06 11:55:01
@@ -266,7 +271,7 @@ do {									\
    else									\
     flag_omit_frame_pointer = 0;					\
 									\
-  if (! TARGET_PREFERGOT)						\
+  if (flag_pic && ! TARGET_PREFERGOT)					\
     flag_no_function_cse = 1;						\
 									\
   /* Never run scheduling before reload, since that can			\

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

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