diff options
author | Jakub Jelinek <jakub@redhat.com> | 2002-02-21 22:11:08 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2002-02-21 22:11:08 +0100 |
commit | 22273300ad1417a429f5d1d0e51e3b954278a72f (patch) | |
tree | 53af922ab93c931646d1f9c027ff95539927bd5e /gcc/expr.c | |
parent | 7133e9921a9cfd599637a1d539b206b21e79545d (diff) | |
download | gcc-22273300ad1417a429f5d1d0e51e3b954278a72f.zip gcc-22273300ad1417a429f5d1d0e51e3b954278a72f.tar.gz gcc-22273300ad1417a429f5d1d0e51e3b954278a72f.tar.bz2 |
re PR c++/4574 (Internal compiler error in `expand_and', at expmed.c:4055)
PR c++/4574
* expr.h (expand_and): Add mode argument.
* expmed.c (expand_and): Add mode argument.
(expand_mult_highpart_adjust, emit_store_flag): Adjust callers.
* expr.c (store_field, expand_expr, do_store_flag): Likewise.
* except.c (expand_builtin_extract_return_addr): Likewise.
* config/alpha/alpha.c (alpha_initialize_trampoline): Likewise.
* config/sparc/sparc.c (sparc_initialize_trampoline): Likewise.
* config/c4x/c4x.h (INITIALIZE_TRAMPOLINE): Likewise.
Use GEN_INT (x) instead of gen_rtx (CONST_INT, VOIDmode, x).
* config/c4x/c4x.md: Use GEN_INT (x) instead of
gen_rtx (CONST_INT, VOIDmode, x).
* gcc.dg/20020220-1.c: New test.
From-SVN: r49938
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 24 |
1 files changed, 11 insertions, 13 deletions
@@ -5143,18 +5143,16 @@ store_field (target, bitsize, bitpos, mode, exp, value_mode, unsignedp, type, tree count; enum machine_mode tmode; - if (unsignedp) - return expand_and (temp, - GEN_INT - (trunc_int_for_mode - (width_mask, - GET_MODE (temp) == VOIDmode - ? value_mode - : GET_MODE (temp))), NULL_RTX); - tmode = GET_MODE (temp); if (tmode == VOIDmode) tmode = value_mode; + + if (unsignedp) + return expand_and (tmode, temp, + GEN_INT (trunc_int_for_mode (width_mask, + tmode)), + NULL_RTX); + count = build_int_2 (GET_MODE_BITSIZE (tmode) - bitsize, 0); temp = expand_shift (LSHIFT_EXPR, tmode, temp, count, 0, 0); return expand_shift (RSHIFT_EXPR, tmode, temp, count, 0, 0); @@ -6785,16 +6783,16 @@ expand_expr (exp, target, tmode, modifier) { HOST_WIDE_INT bitsize = TREE_INT_CST_LOW (DECL_SIZE (TREE_PURPOSE (elt))); + enum machine_mode imode + = TYPE_MODE (TREE_TYPE (TREE_PURPOSE (elt))); if (TREE_UNSIGNED (TREE_TYPE (TREE_PURPOSE (elt)))) { op1 = GEN_INT (((HOST_WIDE_INT) 1 << bitsize) - 1); - op0 = expand_and (op0, op1, target); + op0 = expand_and (imode, op0, op1, target); } else { - enum machine_mode imode - = TYPE_MODE (TREE_TYPE (TREE_PURPOSE (elt))); tree count = build_int_2 (GET_MODE_BITSIZE (imode) - bitsize, 0); @@ -10222,7 +10220,7 @@ do_store_flag (exp, target, mode, only_cheap) /* Put the AND last so it can combine with more things. */ if (bitnum != TYPE_PRECISION (type) - 1) - op0 = expand_and (op0, const1_rtx, subtarget); + op0 = expand_and (mode, op0, const1_rtx, subtarget); return op0; } |