aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcse.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2001-04-11 18:22:46 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2001-04-11 18:22:46 +0000
commitf1fa37ff6bbd4f760f7df6e60dd44cf731d79f44 (patch)
tree36d9539f4aea987e424c87b9c099ac485cbe15f3 /gcc/gcse.c
parentf3a8030a5bb6a347cdfd4c9fcedabb76bac54ea5 (diff)
downloadgcc-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/gcse.c')
-rw-r--r--gcc/gcse.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/gcse.c b/gcc/gcse.c
index 9121af7..402e85e 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -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)
{