diff options
author | Richard Henderson <rth@cygnus.com> | 1998-10-09 08:50:25 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 1998-10-09 08:50:25 -0700 |
commit | d006aa54babb7e5c6074e06b71d6ae65e9172c5b (patch) | |
tree | dcc7d4ffbedc5308ac113fce833c31a0318fd188 /gcc/stor-layout.c | |
parent | 3663a3047f7ec94514d5c76483f1b7e8457934cf (diff) | |
download | gcc-d006aa54babb7e5c6074e06b71d6ae65e9172c5b.tar.gz |
expmed.c (store_bit_field): Pun non-integral str_rtx modes.
* expmed.c (store_bit_field): Pun non-integral str_rtx modes.
Take extra care for op0 now possibly being a subreg.
(extract_bit_field): Likewise.
* function.c (purge_addressof_1): Revert Oct 4 change. Drop
the reg to memory if there is no equal sized integral mode.
* stor-layout.c (int_mode_for_mode): New function.
* machmode.h: Prototype it.
From-SVN: r22962
Diffstat (limited to 'gcc/stor-layout.c')
-rw-r--r-- | gcc/stor-layout.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index 3c7cf23d7d3..a6bf053ba76 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -176,6 +176,37 @@ smallest_mode_for_size (size, class) abort (); } +/* Find an integer mode of the exact same size, or BLKmode on failure. */ + +enum machine_mode +int_mode_for_mode (mode) + enum machine_mode mode; +{ + switch (GET_MODE_CLASS (mode)) + { + case MODE_INT: + case MODE_PARTIAL_INT: + break; + + case MODE_COMPLEX_INT: + case MODE_COMPLEX_FLOAT: + case MODE_FLOAT: + mode = mode_for_size (GET_MODE_BITSIZE (mode), MODE_INT, 0); + break; + + case MODE_RANDOM: + if (mode == BLKmode) + break; + /* FALLTHRU */ + + case MODE_CC: + default: + abort(); + } + + return mode; +} + /* Return the value of VALUE, rounded up to a multiple of DIVISOR. */ tree |