summaryrefslogtreecommitdiff
path: root/gcc/gcse.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/gcse.c')
-rw-r--r--gcc/gcse.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/gcc/gcse.c b/gcc/gcse.c
index b0a18689326..6f345ccbce6 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -143,6 +143,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tm.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "rtl.h"
@@ -169,6 +170,7 @@ along with GCC; see the file COPYING3. If not see
#include "df.h"
#include "dbgcnt.h"
#include "target.h"
+#include "gcse.h"
/* We support GCSE via Partial Redundancy Elimination. PRE optimizations
are a superset of those done by classic GCSE.
@@ -262,6 +264,11 @@ along with GCC; see the file COPYING3. If not see
/* GCSE global vars. */
+struct target_gcse default_target_gcse;
+#if SWITCHABLE_TARGET
+struct target_gcse *this_target_gcse = &default_target_gcse;
+#endif
+
/* Set to non-zero if CSE should run after all GCSE optimizations are done. */
int flag_rerun_cse_after_global_opts;
@@ -538,10 +545,10 @@ static bool is_too_expensive (const char *);
/* Misc. utilities. */
-/* Nonzero for each mode that supports (set (reg) (reg)).
- This is trivially true for integer and floating point values.
- It may or may not be true for condition codes. */
-static char can_copy[(int) NUM_MACHINE_MODES];
+#define can_copy \
+ (this_target_gcse->x_can_copy)
+#define can_copy_init_p \
+ (this_target_gcse->x_can_copy_init_p)
/* Compute which modes support reg/reg copy operations. */
@@ -578,8 +585,6 @@ compute_can_copy (void)
bool
can_copy_p (enum machine_mode mode)
{
- static bool can_copy_init_p = false;
-
if (! can_copy_init_p)
{
compute_can_copy ();