diff options
author | Richard Biener <rguenther@suse.de> | 2015-03-13 08:52:51 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2015-03-13 08:52:51 +0000 |
commit | 2aa26a5543cfd6fc2c03051d532f778da8318e9b (patch) | |
tree | 8fc2a2876c706f677325a184d1ccf5c45ac26b51 /gcc/tree-inline.c | |
parent | 2a5671ee800de5ace6b9d78cd47de73a04d92fa8 (diff) | |
download | gcc-2aa26a5543cfd6fc2c03051d532f778da8318e9b.zip gcc-2aa26a5543cfd6fc2c03051d532f778da8318e9b.tar.gz gcc-2aa26a5543cfd6fc2c03051d532f778da8318e9b.tar.bz2 |
re PR ipa/44563 (GCC uses a lot of RAM when compiling a large numbers of functions)
2015-03-12 Richard Biener <rguenther@suse.de>
PR middle-end/44563
* tree-inline.c (gimple_expand_calls_inline): Walk BB backwards
to avoid quadratic behavior with inline expansion splitting blocks.
* tree-cfgcleanup.c (cleanup_tree_cfg_bb): Do not merge block
with the successor if the predecessor will be merged with it.
* tree-cfg.c (gimple_can_merge_blocks_p): We can't merge the
entry block with its successor.
From-SVN: r221410
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r-- | gcc/tree-inline.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 259a348..83e4335 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -4779,18 +4779,19 @@ static bool gimple_expand_calls_inline (basic_block bb, copy_body_data *id) { gimple_stmt_iterator gsi; + bool inlined = false; - for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi)) + for (gsi = gsi_last_bb (bb); !gsi_end_p (gsi);) { gimple stmt = gsi_stmt (gsi); + gsi_prev (&gsi); if (is_gimple_call (stmt) - && !gimple_call_internal_p (stmt) - && expand_call_inline (bb, stmt, id)) - return true; + && !gimple_call_internal_p (stmt)) + inlined |= expand_call_inline (bb, stmt, id); } - return false; + return inlined; } |