diff options
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 56 |
1 files changed, 24 insertions, 32 deletions
diff --git a/gcc/expr.c b/gcc/expr.c index e54f3e47a45..c99d77945ff 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -1,5 +1,5 @@ /* Convert tree expression to rtl instructions, for GNU compiler. - Copyright (C) 1988, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc. + Copyright (C) 1988, 92-97, 1998 Free Software Foundation, Inc. This file is part of GNU CC. @@ -2437,7 +2437,7 @@ get_push_address (size) else temp = stack_pointer_rtx; - return force_operand (temp, NULL_RTX); + return copy_to_reg (temp); } /* Generate code to push X onto the stack, assuming it has mode MODE and @@ -2566,7 +2566,7 @@ emit_push_insn (x, mode, type, size, align, partial, reg, extra, in_check_memory_usage = 1; temp = get_push_address (INTVAL(size) - used); - if (GET_CODE (x) == MEM && AGGREGATE_TYPE_P (type)) + if (GET_CODE (x) == MEM && type && AGGREGATE_TYPE_P (type)) emit_library_call (chkr_copy_bitmap_libfunc, 1, VOIDmode, 3, temp, ptr_mode, XEXP (xinner, 0), ptr_mode, @@ -2622,7 +2622,7 @@ emit_push_insn (x, mode, type, size, align, partial, reg, extra, in_check_memory_usage = 1; target = copy_to_reg (temp); - if (GET_CODE (x) == MEM && AGGREGATE_TYPE_P (type)) + if (GET_CODE (x) == MEM && type && AGGREGATE_TYPE_P (type)) emit_library_call (chkr_copy_bitmap_libfunc, 1, VOIDmode, 3, target, ptr_mode, XEXP (xinner, 0), ptr_mode, @@ -2834,7 +2834,7 @@ emit_push_insn (x, mode, type, size, align, partial, reg, extra, if (target == 0) target = get_push_address (GET_MODE_SIZE (mode)); - if (GET_CODE (x) == MEM && AGGREGATE_TYPE_P (type)) + if (GET_CODE (x) == MEM && type && AGGREGATE_TYPE_P (type)) emit_library_call (chkr_copy_bitmap_libfunc, 1, VOIDmode, 3, target, ptr_mode, XEXP (x, 0), ptr_mode, @@ -5512,12 +5512,16 @@ expand_expr (exp, target, tmode, modifier) memory_usage = get_memory_usage_from_modifier (modifier); if (memory_usage != MEMORY_USE_DONT) - emit_library_call (chkr_check_addr_libfunc, 1, VOIDmode, 3, - op0, ptr_mode, - GEN_INT (int_size_in_bytes (type)), - TYPE_MODE (sizetype), - GEN_INT (memory_usage), - TYPE_MODE (integer_type_node)); + { + in_check_memory_usage = 1; + emit_library_call (chkr_check_addr_libfunc, 1, VOIDmode, 3, + op0, ptr_mode, + GEN_INT (int_size_in_bytes (type)), + TYPE_MODE (sizetype), + GEN_INT (memory_usage), + TYPE_MODE (integer_type_node)); + in_check_memory_usage = 0; + } } temp = gen_rtx (MEM, mode, op0); @@ -8320,6 +8324,11 @@ expand_builtin_setjmp (buf_addr, target) #endif abort (); +#ifdef HAVE_builtin_setjmp_receiver + if (HAVE_builtin_setjmp_receiver) + emit_insn (gen_builtin_setjmp_receiver ()); +#endif + emit_move_insn (target, const1_rtx); emit_label (lab2); return target; @@ -9003,8 +9012,8 @@ expand_builtin (exp, target, subtarget, mode, ignore) /* Just copy the rights of SRC to the rights of DEST. */ if (flag_check_memory_usage) emit_library_call (chkr_copy_bitmap_libfunc, 1, VOIDmode, 3, - src_rtx, ptr_mode, dest_rtx, ptr_mode, + src_rtx, ptr_mode, len_rtx, TYPE_MODE (sizetype)); /* There could be a void* cast on top of the object. */ @@ -11119,29 +11128,12 @@ do_store_flag (exp, target, mode, only_cheap) if ((code == NE || code == EQ) && TREE_CODE (arg0) == BIT_AND_EXPR && integer_zerop (arg1) - && integer_pow2p (TREE_OPERAND (arg0, 1)) - && TYPE_PRECISION (type) <= HOST_BITS_PER_WIDE_INT) + && integer_pow2p (TREE_OPERAND (arg0, 1))) { tree inner = TREE_OPERAND (arg0, 0); - HOST_WIDE_INT tem; - int bitnum; + int bitnum = tree_log2 (TREE_OPERAND (arg0, 1)); int ops_unsignedp; - tem = INTVAL (expand_expr (TREE_OPERAND (arg0, 1), - NULL_RTX, VOIDmode, 0)); - /* In this case, immed_double_const will sign extend the value to make - it look the same on the host and target. We must remove the - sign-extension before calling exact_log2, since exact_log2 will - fail for negative values. */ - if (BITS_PER_WORD < HOST_BITS_PER_WIDE_INT - && BITS_PER_WORD == GET_MODE_BITSIZE (TYPE_MODE (type))) - /* We don't use the obvious constant shift to generate the mask, - because that generates compiler warnings when BITS_PER_WORD is - greater than or equal to HOST_BITS_PER_WIDE_INT, even though this - code is unreachable in that case. */ - tem = tem & GET_MODE_MASK (word_mode); - bitnum = exact_log2 (tem); - /* If INNER is a right shift of a constant and it plus BITNUM does not overflow, adjust BITNUM and INNER. */ @@ -11151,7 +11143,7 @@ do_store_flag (exp, target, mode, only_cheap) && (bitnum + TREE_INT_CST_LOW (TREE_OPERAND (inner, 1)) < TYPE_PRECISION (type))) { - bitnum +=TREE_INT_CST_LOW (TREE_OPERAND (inner, 1)); + bitnum += TREE_INT_CST_LOW (TREE_OPERAND (inner, 1)); inner = TREE_OPERAND (inner, 0); } |