diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-10-09 15:50:25 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-10-09 15:50:25 +0000 |
commit | 86cde393d905d784e6808e01d199675dfa3d6fcd (patch) | |
tree | dcc7d4ffbedc5308ac113fce833c31a0318fd188 /gcc/stor-layout.c | |
parent | 3cf7d3b94b2170181803828fe49030a91087a9bc (diff) | |
download | gcc-86cde393d905d784e6808e01d199675dfa3d6fcd.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@22962 138bc75d-0d04-0410-961f-82ee72b054a4
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 |