diff options
author | Jim Wilson <wilson@cygnus.com> | 2000-10-25 01:30:25 +0000 |
---|---|---|
committer | Jim Wilson <wilson@gcc.gnu.org> | 2000-10-24 18:30:25 -0700 |
commit | a8ca77564609454aa4bad648471204640a55b300 (patch) | |
tree | 9642e7e20204571cf15e101b98b0af82637ce77f /gcc/expmed.c | |
parent | c0fc376bcfaaf42823c07e5cd8420343fd56b370 (diff) | |
download | gcc-a8ca77564609454aa4bad648471204640a55b300.zip gcc-a8ca77564609454aa4bad648471204640a55b300.tar.gz gcc-a8ca77564609454aa4bad648471204640a55b300.tar.bz2 |
Fixes for C++ structure layout breakage.
* expmed.c (store_bit_field): Move integer pun code down after
code that calls emit_move_insn for entire register move.
* stor-layout.c (compute_record_mode): Revert Mar 25, Aug 18, and
Oct 20 changes. Only store mode in TYPE_MODE if RECORD_TYPE.
From-SVN: r37041
Diffstat (limited to 'gcc/expmed.c')
-rw-r--r-- | gcc/expmed.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/gcc/expmed.c b/gcc/expmed.c index 2605062..254d052 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -269,21 +269,6 @@ store_bit_field (str_rtx, bitsize, bitnum, fieldmode, value, align, total_size) op0 = SUBREG_REG (op0); } - /* Make sure we are playing with integral modes. Pun with subregs - if we aren't. */ - { - enum machine_mode imode = int_mode_for_mode (GET_MODE (op0)); - if (imode != GET_MODE (op0)) - { - if (GET_CODE (op0) == MEM) - op0 = change_address (op0, imode, NULL_RTX); - else if (imode != BLKmode) - op0 = gen_lowpart (imode, op0); - else - abort (); - } - } - /* If OP0 is a register, BITPOS must count within a word. But as we have it, it counts within whatever size OP0 now has. On a bigendian machine, these are not the same, so convert. */ @@ -337,6 +322,23 @@ store_bit_field (str_rtx, bitsize, bitnum, fieldmode, value, align, total_size) return value; } + /* Make sure we are playing with integral modes. Pun with subregs + if we aren't. This must come after the entire register case above, + since that case is valid for any mode. The following cases are only + valid for integral modes. */ + { + enum machine_mode imode = int_mode_for_mode (GET_MODE (op0)); + if (imode != GET_MODE (op0)) + { + if (GET_CODE (op0) == MEM) + op0 = change_address (op0, imode, NULL_RTX); + else if (imode != BLKmode) + op0 = gen_lowpart (imode, op0); + else + abort (); + } + } + /* Storing an lsb-aligned field in a register can be done with a movestrict instruction. */ |