diff options
author | Mark Mitchell <mark@codesourcery.com> | 2001-04-11 18:22:46 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2001-04-11 18:22:46 +0000 |
commit | f1fa37ff6bbd4f760f7df6e60dd44cf731d79f44 (patch) | |
tree | 36d9539f4aea987e424c87b9c099ac485cbe15f3 /gcc | |
parent | f3a8030a5bb6a347cdfd4c9fcedabb76bac54ea5 (diff) | |
download | gcc-f1fa37ff6bbd4f760f7df6e60dd44cf731d79f44.zip gcc-f1fa37ff6bbd4f760f7df6e60dd44cf731d79f44.tar.gz gcc-f1fa37ff6bbd4f760f7df6e60dd44cf731d79f44.tar.bz2 |
Makefile.in (gcse.o): Depend on params.h.
* Makefile.in (gcse.o): Depend on params.h.
* gcse.c: Include params.h.
(gcse_main): Don't do GCSE if doing so will take inordinate
amounts of memory.
* params.def (PARAM_MAX_GCSE_MEMORY): New parameter.
* params.h (MAX_GCSE_MEMORY): New macro.
From-SVN: r41260
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/Makefile.in | 2 | ||||
-rw-r--r-- | gcc/gcse.c | 14 | ||||
-rw-r--r-- | gcc/params.def | 7 | ||||
-rw-r--r-- | gcc/params.h | 2 |
5 files changed, 33 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2f0ab44..69015e9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2001-04-11 Mark Mitchell <mark@codesourcery.com> + + * Makefile.in (gcse.o): Depend on params.h. + * gcse.c: Include params.h. + (gcse_main): Don't do GCSE if doing so will take inordinate + amounts of memory. + * params.def (PARAM_MAX_GCSE_MEMORY): New parameter. + * params.h (MAX_GCSE_MEMORY): New macro. + 2001-04-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * Makefile.in (insn-output.o): Depend on $(EXPR_H). diff --git a/gcc/Makefile.in b/gcc/Makefile.in index c94eb08..04757de 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -1465,7 +1465,7 @@ cse.o : cse.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(REGS_H) hard-reg-set.h flags.h $(BASIC_BLOCK_H) $(GGC_H) $(TM_P_H) gcse.o : gcse.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(REGS_H) hard-reg-set.h \ flags.h real.h insn-config.h ggc.h $(RECOG_H) $(EXPR_H) $(BASIC_BLOCK_H) \ - function.h output.h toplev.h $(TM_P_H) + function.h output.h toplev.h $(TM_P_H) params.h sibcall.o : sibcall.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(REGS_H) function.h \ hard-reg-set.h flags.h insn-config.h $(RECOG_H) $(BASIC_BLOCK_H) resource.o : resource.c $(CONFIG_H) $(RTL_H) hard-reg-set.h $(SYSTEM_H) \ @@ -160,6 +160,7 @@ Boston, MA 02111-1307, USA. */ #include "function.h" #include "expr.h" #include "ggc.h" +#include "params.h" #include "obstack.h" #define obstack_chunk_alloc gmalloc @@ -767,6 +768,19 @@ gcse_main (f, file) return 0; } + /* If allocating memory for the cprop bitmap would take up too much + storage it's better just to disable the optimization. */ + if ((n_basic_blocks + * SBITMAP_SET_SIZE (max_gcse_regno) + * sizeof (SBITMAP_ELT_TYPE)) > MAX_GCSE_MEMORY) + { + if (warn_disabled_optimization) + warning ("GCSE disabled: %d basic blocks and %d registers", + n_basic_blocks, max_gcse_regno); + + return 0; + } + /* See what modes support reg/reg copy operations. */ if (! can_copy_init_p) { diff --git a/gcc/params.def b/gcc/params.def index aae7068..749414f 100644 --- a/gcc/params.def +++ b/gcc/params.def @@ -66,6 +66,13 @@ DEFPARAM(PARAM_MAX_DELAY_SLOT_LIVE_SEARCH, "The maximum number of instructions to consider to find accurate live register information", 333) +/* The GCSE optimization will be disabled if it would require + significantly more memory than this value. */ +DEFPARAM(PARAM_MAX_GCSE_MEMORY, + "max-gcse-memory", + "The maximum amount of memory to be allocated by GCSE", + 50 * 1024 * 1024) + /* Local variables: mode:c diff --git a/gcc/params.h b/gcc/params.h index d5336f2..d97e7bb 100644 --- a/gcc/params.h +++ b/gcc/params.h @@ -88,5 +88,7 @@ typedef enum compiler_param PARAM_VALUE (PARAM_MAX_DELAY_SLOT_INSN_SEARCH) #define MAX_DELAY_SLOT_LIVE_SEARCH \ PARAM_VALUE (PARAM_MAX_DELAY_SLOT_LIVE_SEARCH) +#define MAX_GCSE_MEMORY \ + ((size_t) PARAM_VALUE (PARAM_MAX_GCSE_MEMORY)) #endif /* PARAMS_H */ |