diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-07-16 21:13:08 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-07-16 21:13:08 +0000 |
commit | 80f0648113a67e5f40ab1c19bed50d37262dbfdf (patch) | |
tree | a6887d7a4c296d5e39f29a2367845311f7100e89 /gcc/explow.c | |
parent | 88a09153515cca1388a7284174c5ff5ae4b93cb0 (diff) | |
download | gcc-80f0648113a67e5f40ab1c19bed50d37262dbfdf.tar.gz |
* tree-def (WITH_SIZE_EXPR): New.
* explow.c (expr_size, int_expr_size): Handle WITH_SIZE_EXPR.
* expr.c (expand_expr_real_1): Likewise.
* gimplify.c (maybe_with_size_expr): New.
(gimplify_arg, gimplify_modify_expr): Use it.
(gimplify_modify_expr_to_memcpy): Take size parameter.
(gimplify_modify_expr_to_memset): Likewise.
(gimplify_expr): Handle WITH_SIZE_EXPR.
* tree-alias-common.c (find_func_aliases): Likewise.
* tree-eh.c (tree_could_trap_p): Likewise.
(tree_could_throw_p): Likewise.
* tree-gimple.c (is_gimple_lvalue): Likewise.
(get_call_expr_in): Likewise.
* tree-inline.c (estimate_num_insns_1): Likewise.
(expand_calls_inline): Likewise.
* tree-nested.c (convert_call_expr): Likewise.
* tree-pretty-print.c (dump_generic_node): Likewise.
* tree-sra.c (sra_walk_expr): Likewise.
* tree-ssa-alias.c (add_pointed_to_expr): Likewise.
* tree-ssa-ccp.c (get_rhs, set_rhs): Likewise.
* tree-ssa-operands.c (get_expr_operands): Likewise.
* tree-tailcall.c (find_tail_calls): Likewise.
* calls.c (expand_call): Reset old_stack_allocated after
calling emit_stack_restore.
* gcc.c-torture/compile/20020210-1.c: Remove XFAIL.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84833 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/explow.c')
-rw-r--r-- | gcc/explow.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/gcc/explow.c b/gcc/explow.c index 54a863501ea..3fb0f94f423 100644 --- a/gcc/explow.c +++ b/gcc/explow.c @@ -240,7 +240,12 @@ eliminate_constant_term (rtx x, rtx *constptr) rtx expr_size (tree exp) { - tree size = SUBSTITUTE_PLACEHOLDER_IN_EXPR (lang_hooks.expr_size (exp), exp); + tree size; + + if (TREE_CODE (exp) == WITH_SIZE_EXPR) + size = TREE_OPERAND (exp, 1); + else + size = SUBSTITUTE_PLACEHOLDER_IN_EXPR (lang_hooks.expr_size (exp), exp); return expand_expr (size, NULL_RTX, TYPE_MODE (sizetype), 0); } @@ -251,17 +256,17 @@ expr_size (tree exp) HOST_WIDE_INT int_expr_size (tree exp) { - tree t = lang_hooks.expr_size (exp); - - if (t == 0 - || TREE_CODE (t) != INTEGER_CST - || TREE_OVERFLOW (t) - || TREE_INT_CST_HIGH (t) != 0 - /* If the result would appear negative, it's too big to represent. */ - || (HOST_WIDE_INT) TREE_INT_CST_LOW (t) < 0) + tree size; + + if (TREE_CODE (exp) == WITH_SIZE_EXPR) + size = TREE_OPERAND (exp, 1); + else + size = lang_hooks.expr_size (exp); + + if (size == 0 || !host_integerp (size, 0)) return -1; - return TREE_INT_CST_LOW (t); + return tree_low_cst (size, 0); } /* Return a copy of X in which all memory references |