diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-10-17 10:54:54 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-10-17 10:54:54 +0000 |
commit | e3668db5075b12cedb96b5d84358b21623257fb5 (patch) | |
tree | 3d9f1e754cc0f6442d99387021c379a081f76de3 /gcc/gimple.c | |
parent | 8016354aa6940bcf9206084c2cdc224dda812b93 (diff) | |
download | gcc-e3668db5075b12cedb96b5d84358b21623257fb5.tar.gz |
PR tree-optimization/63464
* gimple.h (gimple_seq_discard): New prototype.
* gimple.c: Include stringpool.h and tree-ssanames.h.
(gimple_seq_discard): New function.
* optabs.h (lshift_cheap_p): New prototype.
* optabs.c (lshift_cheap_p): New function, moved from...
* tree-switch-conversion.c (lshift_cheap_p): ... here.
* tree-ssa-reassoc.c: Include gimplify.h and optabs.h.
(reassoc_branch_fixups): New variable.
(update_range_test): Add otherrangep and seq arguments.
Unshare exp. If otherrange is NULL, use for other ranges
array of pointers pointed by otherrangep instead.
Emit seq before gimplified statements for tem.
(optimize_range_tests_diff): Adjust update_range_test
caller.
(optimize_range_tests_xor): Likewise. Fix up comment.
(extract_bit_test_mask, optimize_range_tests_to_bit_test): New
functions.
(optimize_range_tests): Adjust update_range_test caller.
Call optimize_range_tests_to_bit_test.
(branch_fixup): New function.
(execute_reassoc): Call branch_fixup.
* gcc.dg/torture/pr63464.c: New test.
* gcc.dg/tree-ssa/reassoc-37.c: New test.
* gcc.dg/tree-ssa/reassoc-38.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@216393 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimple.c')
-rw-r--r-- | gcc/gimple.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/gimple.c b/gcc/gimple.c index da993214ef8..233b4362911 100644 --- a/gcc/gimple.c +++ b/gcc/gimple.c @@ -47,6 +47,8 @@ along with GCC; see the file COPYING3. If not see #include "demangle.h" #include "langhooks.h" #include "bitmap.h" +#include "stringpool.h" +#include "tree-ssanames.h" /* All the tuples have their operand vector (if present) at the very bottom @@ -2826,3 +2828,19 @@ gimple_seq_set_location (gimple_seq seq, location_t loc) for (gimple_stmt_iterator i = gsi_start (seq); !gsi_end_p (i); gsi_next (&i)) gimple_set_location (gsi_stmt (i), loc); } + +/* Release SSA_NAMEs in SEQ as well as the GIMPLE statements. */ + +void +gimple_seq_discard (gimple_seq seq) +{ + gimple_stmt_iterator gsi; + + for (gsi = gsi_start (seq); !gsi_end_p (gsi); ) + { + gimple stmt = gsi_stmt (gsi); + gsi_remove (&gsi, true); + release_defs (stmt); + ggc_free (stmt); + } +} |