diff options
Diffstat (limited to 'gcc/gcse.c')
-rw-r--r-- | gcc/gcse.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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) { |