This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] tree-cfg.c: Reduce the amount of memory allocated inthread_jumps.


Hi,

Attached is a patch to reduce the amount of memory allocated in
thread_jumps.

In thread_jumps, we make sure that no duplicate basic block is entered
into WORKLIST.  We never put ENTRY_BLOCK_PTR or EXIT_BLOCK_PTR,
either, so WORKLIST with N_BASIC_BLOCKS entries is big enough.

Tested on i686-pc-linux-gnu.  OK to apply?

p.s.
This patch is also a part of Zdenek's patch to fix PR 18601.

http://gcc.gnu.org/ml/gcc-patches/2004-11/msg02089.html

Kazu Hirata

2004-12-02  Kazu Hirata  <kazu@cs.umass.edu>

	* tree-cfg.c (thread_jumps): Reduce the size of WORKLIST.

Index: tree-cfg.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-cfg.c,v
retrieving revision 2.129
diff -u -d -p -r2.129 tree-cfg.c
--- tree-cfg.c	30 Nov 2004 03:52:37 -0000	2.129
+++ tree-cfg.c	1 Dec 2004 21:12:47 -0000
@@ -4107,7 +4107,7 @@ thread_jumps (void)
 {
   basic_block bb;
   bool retval = false;
-  basic_block *worklist = xmalloc (sizeof (basic_block) * last_basic_block);
+  basic_block *worklist = xmalloc (sizeof (basic_block) * n_basic_blocks);
   basic_block *current = worklist;
 
   FOR_EACH_BB (bb)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]