diff options
author | Richard Henderson <rth@redhat.com> | 2002-03-01 00:13:04 -0800 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2002-03-01 00:13:04 -0800 |
commit | 32b069d30ca0143044bec45e65d42f68664459f9 (patch) | |
tree | d6e2a96ae3e3138d8b7b8d3949ecce65c7c9ed6b /gcc/expmed.c | |
parent | fdc9bf29461a61a92db99cc4b0459d23433cdcee (diff) | |
download | gcc-32b069d30ca0143044bec45e65d42f68664459f9.zip gcc-32b069d30ca0143044bec45e65d42f68664459f9.tar.gz gcc-32b069d30ca0143044bec45e65d42f68664459f9.tar.bz2 |
expmed.c (store_bit_field): Prevent generation of CONCATs...
* expmed.c (store_bit_field): Prevent generation of CONCATs;
pun complex values as integers; use gen_lowpart instead of
gen_rtx_SUBREG.
(extract_bit_field): Likewise.
From-SVN: r50185
Diffstat (limited to 'gcc/expmed.c')
-rw-r--r-- | gcc/expmed.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/gcc/expmed.c b/gcc/expmed.c index 46007a3..6f9a939 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -325,7 +325,12 @@ store_bit_field (str_rtx, bitsize, bitnum, fieldmode, value, total_size) value = protect_from_queue (value, 0); if (flag_force_mem) - value = force_not_mem (value); + { + int old_generating_concat_p = generating_concat_p; + generating_concat_p = 0; + value = force_not_mem (value); + generating_concat_p = old_generating_concat_p; + } /* If the target is a register, overwriting the entire object, or storing a full-word or multi-word field can be done with just a SUBREG. @@ -519,12 +524,9 @@ store_bit_field (str_rtx, bitsize, bitnum, fieldmode, value, total_size) corresponding size. This can occur on a machine with 64 bit registers that uses SFmode for float. This can also occur for unaligned float structure fields. */ - if (GET_MODE_CLASS (GET_MODE (value)) == MODE_FLOAT) - { - if (GET_CODE (value) != REG) - value = copy_to_reg (value); - value = gen_rtx_SUBREG (word_mode, value, 0); - } + if (GET_MODE_CLASS (GET_MODE (value)) != MODE_INT + && GET_MODE_CLASS (GET_MODE (value)) != MODE_PARTIAL_INT) + value = gen_lowpart (word_mode, value); /* Now OFFSET is nonzero only if OP0 is memory and is therefore always measured in bytes. */ @@ -1516,14 +1518,13 @@ extract_bit_field (str_rtx, bitsize, bitnum, unsignedp, /* If the target mode is floating-point, first convert to the integer mode of that size and then access it as a floating-point value via a SUBREG. */ - if (GET_MODE_CLASS (tmode) == MODE_FLOAT) + if (GET_MODE_CLASS (tmode) != MODE_INT + && GET_MODE_CLASS (tmode) != MODE_PARTIAL_INT) { target = convert_to_mode (mode_for_size (GET_MODE_BITSIZE (tmode), MODE_INT, 0), target, unsignedp); - if (GET_CODE (target) != REG) - target = copy_to_reg (target); - return gen_rtx_SUBREG (tmode, target, 0); + return gen_lowpart (tmode, target); } else return convert_to_mode (tmode, target, unsignedp); |