diff mbox

[1/8] add default for NO_FUNCTION_CSE

Message ID 1430114140-15817-2-git-send-email-tbsaunde+gcc@tbsaunde.org
State New
Headers show

Commit Message

tbsaunde+gcc@tbsaunde.org April 27, 2015, 5:55 a.m. UTC
From: Trevor Saunders <tbsaunde+gcc@tbsaunde.org>

gcc/ChangeLog:

2015-04-26  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* calls.c (prepare_call_address): Remove ifdef NO_FUNCTION_CSE.
	* cse.c (fold_rtx): Likewise.
	* config/alpha/alpha.h (NO_FUNCTION_CSE): Define to 1.
	* config/arc/arc.h (NO_FUNCTION_CSE): Likewise.
	* config/avr/avr.h (NO_FUNCTION_CSE): Likewise.
	* config/cr16/cr16.h (NO_FUNCTION_CSE): Likewise.
	* config/epiphany/epiphany.h (NO_FUNCTION_CSE): Likewise.
	* config/frv/frv.h (NO_FUNCTION_CSE): Likewise.
	* config/h8300/h8300.h (NO_FUNCTION_CSE): Likewise.
	* config/i386/i386.h (NO_FUNCTION_CSE): Likewise.
	* config/ia64/ia64.h (NO_FUNCTION_CSE): Likewise.
	* config/lm32/lm32.h (enum reg_class) (NO_FUNCTION_CSE):
	* Likewise.
	* config/m32r/m32r.h (NO_FUNCTION_CSE): Likewise.
	* config/mep/mep.h (NO_FUNCTION_CSE): Likewise.
	* config/mn10300/mn10300.h (NO_FUNCTION_CSE): Likewise.
	* config/nds32/nds32.h (NO_FUNCTION_CSE): Likewise.
	* config/nios2/nios2.h (NO_FUNCTION_CSE): Likewise.
	* config/pa/pa.h (NO_FUNCTION_CSE): Likewise.
	* config/rs6000/rs6000.h (NO_FUNCTION_CSE): Likewise.
	* config/s390/s390.h (NO_FUNCTION_CSE): Likewise.
	* config/sparc/sparc.h (NO_FUNCTION_CSE): Likewise.
	* config/spu/spu.h (NO_FUNCTION_CSE): Likewise.
	* config/stormy16/stormy16.h (NO_FUNCTION_CSE): Likewise.
	* config/v850/v850.h (NO_FUNCTION_CSE): Likewise.
	* defaults.h (NO_FUNCTION_CSE): Provide default definition to 0.
	* doc/tm.texi: Regenerate.
	* doc/tm.texi.in: Document NO_FUNCTION_CSE is always defined to
	either true or false.
---
 gcc/ChangeLog                  | 32 ++++++++++++++++++++++++++++++++
 gcc/calls.c                    |  4 +---
 gcc/config/alpha/alpha.h       |  2 +-
 gcc/config/arc/arc.h           |  2 +-
 gcc/config/avr/avr.h           |  2 +-
 gcc/config/cr16/cr16.h         |  2 +-
 gcc/config/epiphany/epiphany.h |  2 +-
 gcc/config/frv/frv.h           |  2 +-
 gcc/config/h8300/h8300.h       |  2 +-
 gcc/config/i386/i386.h         |  2 +-
 gcc/config/ia64/ia64.h         |  2 +-
 gcc/config/lm32/lm32.h         |  2 +-
 gcc/config/m32r/m32r.h         |  2 +-
 gcc/config/mep/mep.h           |  2 +-
 gcc/config/mn10300/mn10300.h   |  2 +-
 gcc/config/nds32/nds32.h       |  2 +-
 gcc/config/nios2/nios2.h       |  2 +-
 gcc/config/pa/pa.h             |  2 +-
 gcc/config/rs6000/rs6000.h     |  2 +-
 gcc/config/s390/s390.h         |  2 +-
 gcc/config/sparc/sparc.h       |  2 +-
 gcc/config/spu/spu.h           |  2 +-
 gcc/config/stormy16/stormy16.h |  2 +-
 gcc/config/v850/v850.h         |  2 +-
 gcc/cse.c                      |  4 +---
 gcc/defaults.h                 |  4 ++++
 gcc/doc/tm.texi                |  2 +-
 gcc/doc/tm.texi.in             |  2 +-
 28 files changed, 62 insertions(+), 30 deletions(-)
diff mbox

Patch

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b1c5356..194e1c4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,35 @@ 
+2015-04-26  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>
+
+	* calls.c (prepare_call_address): Remove ifdef NO_FUNCTION_CSE.
+	* cse.c (fold_rtx): Likewise.
+	* config/alpha/alpha.h (NO_FUNCTION_CSE): Define to 1.
+	* config/arc/arc.h (NO_FUNCTION_CSE): Likewise.
+	* config/avr/avr.h (NO_FUNCTION_CSE): Likewise.
+	* config/cr16/cr16.h (NO_FUNCTION_CSE): Likewise.
+	* config/epiphany/epiphany.h (NO_FUNCTION_CSE): Likewise.
+	* config/frv/frv.h (NO_FUNCTION_CSE): Likewise.
+	* config/h8300/h8300.h (NO_FUNCTION_CSE): Likewise.
+	* config/i386/i386.h (NO_FUNCTION_CSE): Likewise.
+	* config/ia64/ia64.h (NO_FUNCTION_CSE): Likewise.
+	* config/lm32/lm32.h (enum reg_class) (NO_FUNCTION_CSE):
+	* Likewise.
+	* config/m32r/m32r.h (NO_FUNCTION_CSE): Likewise.
+	* config/mep/mep.h (NO_FUNCTION_CSE): Likewise.
+	* config/mn10300/mn10300.h (NO_FUNCTION_CSE): Likewise.
+	* config/nds32/nds32.h (NO_FUNCTION_CSE): Likewise.
+	* config/nios2/nios2.h (NO_FUNCTION_CSE): Likewise.
+	* config/pa/pa.h (NO_FUNCTION_CSE): Likewise.
+	* config/rs6000/rs6000.h (NO_FUNCTION_CSE): Likewise.
+	* config/s390/s390.h (NO_FUNCTION_CSE): Likewise.
+	* config/sparc/sparc.h (NO_FUNCTION_CSE): Likewise.
+	* config/spu/spu.h (NO_FUNCTION_CSE): Likewise.
+	* config/stormy16/stormy16.h (NO_FUNCTION_CSE): Likewise.
+	* config/v850/v850.h (NO_FUNCTION_CSE): Likewise.
+	* defaults.h (NO_FUNCTION_CSE): Provide default definition to 0.
+	* doc/tm.texi: Regenerate.
+	* doc/tm.texi.in: Document NO_FUNCTION_CSE is always defined to
+	either true or false.
+
 2015-04-24  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
 	* config/arm/unknown-elf.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): fix
diff --git a/gcc/calls.c b/gcc/calls.c
index 3be7ca5..a6cd33b 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -227,10 +227,8 @@  prepare_call_address (tree fndecl_or_type, rtx funexp, rtx static_chain_value,
 	      : memory_address (FUNCTION_MODE, funexp));
   else if (! sibcallp)
     {
-#ifndef NO_FUNCTION_CSE
-      if (optimize && ! flag_no_function_cse)
+      if (!NO_FUNCTION_CSE && optimize && ! flag_no_function_cse)
 	funexp = force_reg (Pmode, funexp);
-#endif
     }
 
   if (static_chain_value != 0
diff --git a/gcc/config/alpha/alpha.h b/gcc/config/alpha/alpha.h
index d218129..fb3849a 100644
--- a/gcc/config/alpha/alpha.h
+++ b/gcc/config/alpha/alpha.h
@@ -933,7 +933,7 @@  do {									     \
    then copy it into a register, thus actually letting the address be
    cse'ed.  */
 
-#define NO_FUNCTION_CSE
+#define NO_FUNCTION_CSE 1
 
 /* Define this to be nonzero if shift instructions ignore all but the low-order
    few bits.  */
diff --git a/gcc/config/arc/arc.h b/gcc/config/arc/arc.h
index 3be5c93..66965b0 100644
--- a/gcc/config/arc/arc.h
+++ b/gcc/config/arc/arc.h
@@ -1108,7 +1108,7 @@  arc_select_cc_mode (OP, X, Y)
 /* Define this macro if it is as good or better to call a constant
    function address than to call an address kept in a register.  */
 /* On the ARC, calling through registers is slow.  */
-#define NO_FUNCTION_CSE
+#define NO_FUNCTION_CSE 1
 
 /* Section selection.  */
 /* WARNING: These section names also appear in dwarfout.c.  */
diff --git a/gcc/config/avr/avr.h b/gcc/config/avr/avr.h
index 9963766..d8bee77 100644
--- a/gcc/config/avr/avr.h
+++ b/gcc/config/avr/avr.h
@@ -362,7 +362,7 @@  typedef struct avr_args
 
 #define SLOW_BYTE_ACCESS 0
 
-#define NO_FUNCTION_CSE
+#define NO_FUNCTION_CSE 1
 
 #define REGISTER_TARGET_PRAGMAS()                                       \
   do {                                                                  \
diff --git a/gcc/config/cr16/cr16.h b/gcc/config/cr16/cr16.h
index e00802d..e5df6f9 100644
--- a/gcc/config/cr16/cr16.h
+++ b/gcc/config/cr16/cr16.h
@@ -467,7 +467,7 @@  struct cumulative_args
 
 /* It is as good or better to call a constant function address than to
    call an address kept in a register.  */
-#define NO_FUNCTION_CSE
+#define NO_FUNCTION_CSE 1
 
 /* Dividing the output into sections.  */
 
diff --git a/gcc/config/epiphany/epiphany.h b/gcc/config/epiphany/epiphany.h
index ca8fa19..dab368c 100644
--- a/gcc/config/epiphany/epiphany.h
+++ b/gcc/config/epiphany/epiphany.h
@@ -692,7 +692,7 @@  typedef struct GTY (()) machine_function
 /* Define this macro if it is as good or better to call a constant
    function address than to call an address kept in a register.  */
 /* On the EPIPHANY, calling through registers is slow.  */
-#define NO_FUNCTION_CSE
+#define NO_FUNCTION_CSE 1
 
 /* Section selection.  */
 /* WARNING: These section names also appear in dwarf2out.c.  */
diff --git a/gcc/config/frv/frv.h b/gcc/config/frv/frv.h
index d896445..394572c 100644
--- a/gcc/config/frv/frv.h
+++ b/gcc/config/frv/frv.h
@@ -1539,7 +1539,7 @@  __asm__("\n"								\
 
 /* Define this macro if it is as good or better to call a constant function
    address than to call an address kept in a register.  */
-#define NO_FUNCTION_CSE
+#define NO_FUNCTION_CSE 1
 
 
 /* Dividing the output into sections.  */
diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h
index 2a47aa8..2770a39 100644
--- a/gcc/config/h8300/h8300.h
+++ b/gcc/config/h8300/h8300.h
@@ -136,7 +136,7 @@  extern const char * const *h8_reg_names;
    Calls through a register are cheaper than calls to named
    functions; however, the register pressure this causes makes
    CSEing of function addresses generally a lose.  */
-#define NO_FUNCTION_CSE
+#define NO_FUNCTION_CSE 1
 
 /* Target machine storage layout */
 
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index d931330..9148459 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -2015,7 +2015,7 @@  do {							\
    Desirable on the 386 because a CALL with a constant address is
    faster than one with a register address.  */
 
-#define NO_FUNCTION_CSE
+#define NO_FUNCTION_CSE 1
 
 /* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE,
    return the mode to be used for the comparison.
diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h
index b3857ba..943faf9 100644
--- a/gcc/config/ia64/ia64.h
+++ b/gcc/config/ia64/ia64.h
@@ -1178,7 +1178,7 @@  do {									\
    Indirect function calls are more expensive that direct function calls, so
    don't cse function addresses.  */
 
-#define NO_FUNCTION_CSE
+#define NO_FUNCTION_CSE 1
 
 
 /* Dividing the output into sections.  */
diff --git a/gcc/config/lm32/lm32.h b/gcc/config/lm32/lm32.h
index 85185c4..04ff7c8 100644
--- a/gcc/config/lm32/lm32.h
+++ b/gcc/config/lm32/lm32.h
@@ -354,7 +354,7 @@  enum reg_class
 
 #define SLOW_BYTE_ACCESS 1
 
-#define NO_FUNCTION_CSE
+#define NO_FUNCTION_CSE 1
 
 #define BRANCH_COST(speed_p, predictable_p) 4
 
diff --git a/gcc/config/m32r/m32r.h b/gcc/config/m32r/m32r.h
index 9eb673d..ee0c447 100644
--- a/gcc/config/m32r/m32r.h
+++ b/gcc/config/m32r/m32r.h
@@ -767,7 +767,7 @@  L2:     .word STATIC
 
 /* Define this macro if it is as good or better to call a constant
    function address than to call an address kept in a register.  */
-#define NO_FUNCTION_CSE
+#define NO_FUNCTION_CSE 1
 
 /* Section selection.  */
 
diff --git a/gcc/config/mep/mep.h b/gcc/config/mep/mep.h
index d59118c..861189d 100644
--- a/gcc/config/mep/mep.h
+++ b/gcc/config/mep/mep.h
@@ -554,7 +554,7 @@  typedef struct
 
 /* Define this macro if it is as good or better to call a constant function
    address than to call an address kept in a register.  */
-#define NO_FUNCTION_CSE 
+#define NO_FUNCTION_CSE 1
 
 
 #define TEXT_SECTION_ASM_OP "\t.text\n\t.core"
diff --git a/gcc/config/mn10300/mn10300.h b/gcc/config/mn10300/mn10300.h
index 3609da8..d41dc4e 100644
--- a/gcc/config/mn10300/mn10300.h
+++ b/gcc/config/mn10300/mn10300.h
@@ -579,7 +579,7 @@  do {									     \
    than accessing full words.  */
 #define SLOW_BYTE_ACCESS 1
 
-#define NO_FUNCTION_CSE
+#define NO_FUNCTION_CSE 1
 
 /* According expr.c, a value of around 6 should minimize code size, and
    for the MN10300 series, that's our primary concern.  */
diff --git a/gcc/config/nds32/nds32.h b/gcc/config/nds32/nds32.h
index 3c7a7b3..963b3a2 100644
--- a/gcc/config/nds32/nds32.h
+++ b/gcc/config/nds32/nds32.h
@@ -831,7 +831,7 @@  enum reg_class
 
 #define SLOW_BYTE_ACCESS 1
 
-#define NO_FUNCTION_CSE
+#define NO_FUNCTION_CSE 1
 
 
 /* Adjusting the Instruction Scheduler.  */
diff --git a/gcc/config/nios2/nios2.h b/gcc/config/nios2/nios2.h
index 117983d..193845b 100644
--- a/gcc/config/nios2/nios2.h
+++ b/gcc/config/nios2/nios2.h
@@ -306,7 +306,7 @@  typedef struct nios2_args
 
 /* It is as good to call a constant function address as to call an address
    kept in a register.  */
-#define NO_FUNCTION_CSE
+#define NO_FUNCTION_CSE 1
 
 /* Position independent code.  */
 
diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h
index 8314ba3..6c48883 100644
--- a/gcc/config/pa/pa.h
+++ b/gcc/config/pa/pa.h
@@ -1048,7 +1048,7 @@  do {									     \
    shouldn't be put through pseudo regs where they can be cse'd.
    Desirable on machines where ordinary constants are expensive
    but a CALL with constant address is cheap.  */
-#define NO_FUNCTION_CSE
+#define NO_FUNCTION_CSE 1
 
 /* Define this to be nonzero if shift instructions ignore all but the low-order
    few bits.  */
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index b13df1b..f9e4f09 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -2080,7 +2080,7 @@  extern unsigned rs6000_pmode;
    shouldn't be put through pseudo regs where they can be cse'd.
    Desirable on machines where ordinary constants are expensive
    but a CALL with constant address is cheap.  */
-#define NO_FUNCTION_CSE
+#define NO_FUNCTION_CSE 1
 
 /* Define this to be nonzero if shift instructions ignore all but the low-order
    few bits.
diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h
index 4953075..f887409 100644
--- a/gcc/config/s390/s390.h
+++ b/gcc/config/s390/s390.h
@@ -745,7 +745,7 @@  do {									\
 #define MAX_MOVE_MAX 16
 
 /* Don't perform CSE on function addresses.  */
-#define NO_FUNCTION_CSE
+#define NO_FUNCTION_CSE 1
 
 /* This value is used in tree-sra to decide whether it might benefical
    to split a struct move into several word-size moves.  For S/390
diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h
index 27ad748..9b64ff4 100644
--- a/gcc/config/sparc/sparc.h
+++ b/gcc/config/sparc/sparc.h
@@ -1518,7 +1518,7 @@  do {									   \
    shouldn't be put through pseudo regs where they can be cse'd.
    Desirable on machines where ordinary constants are expensive
    but a CALL with constant address is cheap.  */
-#define NO_FUNCTION_CSE
+#define NO_FUNCTION_CSE 1
 
 /* The _Q_* comparison libcalls return booleans.  */
 #define FLOAT_LIB_COMPARE_RETURNS_BOOL(MODE, COMPARISON) ((MODE) == TFmode)
diff --git a/gcc/config/spu/spu.h b/gcc/config/spu/spu.h
index de26d2a..24d8047 100644
--- a/gcc/config/spu/spu.h
+++ b/gcc/config/spu/spu.h
@@ -407,7 +407,7 @@  do {									\
 
 #define MOVE_RATIO(speed) ((speed)? 32 : 4)
 
-#define NO_FUNCTION_CSE
+#define NO_FUNCTION_CSE 1
 
 
 /* Sections */
diff --git a/gcc/config/stormy16/stormy16.h b/gcc/config/stormy16/stormy16.h
index 338c08e..38a2a06 100644
--- a/gcc/config/stormy16/stormy16.h
+++ b/gcc/config/stormy16/stormy16.h
@@ -345,7 +345,7 @@  enum reg_class
 
 #define SLOW_BYTE_ACCESS 0
 
-#define NO_FUNCTION_CSE
+#define NO_FUNCTION_CSE 1
 
 
 /* Dividing the output into sections.  */
diff --git a/gcc/config/v850/v850.h b/gcc/config/v850/v850.h
index 508ef85..2f0118c 100644
--- a/gcc/config/v850/v850.h
+++ b/gcc/config/v850/v850.h
@@ -710,7 +710,7 @@  do {									\
 
 /* Indirect calls are expensive, never turn a direct call
    into an indirect call.  */
-#define NO_FUNCTION_CSE
+#define NO_FUNCTION_CSE 1
 
 /* The four different data regions on the v850.  */
 typedef enum 
diff --git a/gcc/cse.c b/gcc/cse.c
index 88a15e4..15eb33e 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -3183,12 +3183,10 @@  fold_rtx (rtx x, rtx_insn *insn)
 	}
       return x;
 
-#ifdef NO_FUNCTION_CSE
     case CALL:
-      if (CONSTANT_P (XEXP (XEXP (x, 0), 0)))
+      if (NO_FUNCTION_CSE && CONSTANT_P (XEXP (XEXP (x, 0), 0)))
 	return x;
       break;
-#endif
 
     /* Anything else goes through the loop below.  */
     default:
diff --git a/gcc/defaults.h b/gcc/defaults.h
index cafcb1e..4ae5d98 100644
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -1209,6 +1209,10 @@  see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #define INSN_REFERENCES_ARE_DELAYED(INSN) false
 #endif
 
+#ifndef NO_FUNCTION_CSE
+#define NO_FUNCTION_CSE false
+#endif
+
 #ifdef GCC_INSN_FLAGS_H
 /* Dependent default target macro definitions
 
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index 6c5bfab..619d7e0 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -6344,7 +6344,7 @@  thing to use for a given mode.  Defaults to the value of
 @end defmac
 
 @defmac NO_FUNCTION_CSE
-Define this macro if it is as good or better to call a constant
+Define this macro to be true if it is as good or better to call a constant
 function address than to call an address kept in a register.
 @end defmac
 
diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in
index 8d6dfbc..6ff7aed 100644
--- a/gcc/doc/tm.texi.in
+++ b/gcc/doc/tm.texi.in
@@ -4708,7 +4708,7 @@  thing to use for a given mode.  Defaults to the value of
 @end defmac
 
 @defmac NO_FUNCTION_CSE
-Define this macro if it is as good or better to call a constant
+Define this macro to be true if it is as good or better to call a constant
 function address than to call an address kept in a register.
 @end defmac