summaryrefslogtreecommitdiff
path: root/gcc/gcse.c
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2010-07-12 19:04:03 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2010-07-12 19:04:03 +0000
commit7c6811fe1e7b07f9ab3ea30d76e615b33ae6a783 (patch)
tree97f6f506973f488da7ec0448ae53b49404c92688 /gcc/gcse.c
parent15e7b94f185a0eb2cb8a0b0fbf4c8d3025f1b40d (diff)
downloadgcc-7c6811fe1e7b07f9ab3ea30d76e615b33ae6a783.tar.gz
Makefile.in (gcse.o, [...]): Depend on gcse.h..
gcc/ * Makefile.in (gcse.o, target-globals.o): Depend on gcse.h.. * gcse.h: New file. * gcse.c: Include gcse.h. (default_target_gcse): New variable. (this_target_gcse): New conditional variable. (can_copy): Redefine as a macro. (can_copy_init_p): New macro. (can_copy_p): Remove can_copy_init_p. * target-globals.h (this_target_gcse): Declare. (target_globals): Add a gcse field. (restore_target_globals): Copy the gcse field to this_target_gcse. * target-globals.c: Include gcse.h. (default_target_globals): Initialize the gcse field. (save_target_globals): Likewise. From-SVN: r162108
Diffstat (limited to 'gcc/gcse.c')
-rw-r--r--gcc/gcse.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/gcc/gcse.c b/gcc/gcse.c
index 0fb2a2c37d0..6f345ccbce6 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -170,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.
@@ -263,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;
@@ -539,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. */
@@ -579,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 ();