aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.h
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2010-11-20 00:48:57 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2010-11-20 00:48:57 +0100
commit8e97bc2bdb4013cbb62d9910083b240e0eb01941 (patch)
treee65b38b3e2f234c14ced25bd4b7e019d0bf01d3f /gcc/tree.h
parentfb3303597e3e88c6c03f2c699ec89c55fb7b7cfc (diff)
downloadgcc-8e97bc2bdb4013cbb62d9910083b240e0eb01941.zip
gcc-8e97bc2bdb4013cbb62d9910083b240e0eb01941.tar.gz
gcc-8e97bc2bdb4013cbb62d9910083b240e0eb01941.tar.bz2
re PR tree-optimization/45830 (Code+rodata increase with -ftree-switch-conversion)
PR tree-optimization/45830 * stmt.c (expand_switch_using_bit_tests_p): New function. (expand_case): Use it. * tree.h (expand_switch_using_bit_tests_p): New prototype. * tree-switch-conversion.c (struct switch_conv_info): Add bit_test_uniq, bit_test_count and bit_test_bb fields. (check_range): Fix a comment. (check_process_case): Compute bit_test_uniq and bit_test_count. (create_temp_arrays): Use XCNEWVEC, merge 3 arrays into one allocation. (free_temp_arrays): Use XDELETEVEC, adjust for the 3 arrays merging. (constructor_contains_same_values_p): Use FOR_EACH_VEC_ELT. (array_value_type): New function. (build_one_array): Use it, if it returned different type, fold_convert all constructor fields and convert back to the wider type in the generated code. (process_switch): Initialize bit_test_uniq, bit_test_count and bit_test_bb fields. Don't optimize if expand_switch_using_bit_tests_p returned true. * gcc.target/i386/pr45830.c: New test. * gcc.c-torture/execute/pr45830.c: New test. From-SVN: r166966
Diffstat (limited to 'gcc/tree.h')
-rw-r--r--gcc/tree.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/tree.h b/gcc/tree.h
index 6ae90f4..90170e7 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -5314,6 +5314,8 @@ extern bool parse_input_constraint (const char **, int, int, int, int,
const char * const *, bool *, bool *);
extern void expand_asm_stmt (gimple);
extern tree resolve_asm_operand_names (tree, tree, tree, tree);
+extern bool expand_switch_using_bit_tests_p (tree, tree, unsigned int,
+ unsigned int);
extern void expand_case (gimple);
extern void expand_decl (tree);
#ifdef HARD_CONST