diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1992-06-20 06:51:46 -0400 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1992-06-20 06:51:46 -0400 |
commit | 77fa0940a0a588210c367358e57154c3b5f07167 (patch) | |
tree | 76c843976b76720a8a8745346d8bf4f8568746e2 /gcc/stor-layout.c | |
parent | 54d8c2432f1b93a4a439786a6d193a1ca0b90af6 (diff) | |
download | gcc-77fa0940a0a588210c367358e57154c3b5f07167.zip gcc-77fa0940a0a588210c367358e57154c3b5f07167.tar.gz gcc-77fa0940a0a588210c367358e57154c3b5f07167.tar.bz2 |
*** empty log message ***
From-SVN: r1223
Diffstat (limited to 'gcc/stor-layout.c')
-rw-r--r-- | gcc/stor-layout.c | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index dc62a6d..16d1dab 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -952,9 +952,9 @@ fixup_unsigned_type (type) VOLATILEP is true or SLOW_BYTE_ACCESS is false, we return the smallest mode meeting these conditions. - Otherwise (VOLATILEP is false and SLOW_BYTE_ACCESS is true), if a mode - whose size is UNITS_PER_WORD meets all the conditions, it is returned - instead. */ + Otherwise (VOLATILEP is false and SLOW_BYTE_ACCESS is true), we return + the largest mode (but a mode no wider than UNITS_PER_WORD) that meets + all the conditions. */ enum machine_mode get_best_mode (bitsize, bitpos, align, largest_mode, volatilep) @@ -987,12 +987,25 @@ get_best_mode (bitsize, bitpos, align, largest_mode, volatilep) || (largest_mode != VOIDmode && unit > GET_MODE_BITSIZE (largest_mode))) return VOIDmode; - if (SLOW_BYTE_ACCESS - && ! volatilep - && BITS_PER_WORD <= MIN (align, BIGGEST_ALIGNMENT) - && (largest_mode == VOIDmode - || BITS_PER_WORD <= GET_MODE_BITSIZE (largest_mode))) - return word_mode; + if (SLOW_BYTE_ACCESS && ! volatilep) + { + enum machine_mode wide_mode = VOIDmode, tmode; + + for (tmode = GET_CLASS_NARROWEST_MODE (MODE_INT); tmode != VOIDmode; + tmode = GET_MODE_WIDER_MODE (tmode)) + { + unit = GET_MODE_BITSIZE (tmode); + if (bitpos / unit == (bitpos + bitsize - 1) / unit + && unit <= BITS_PER_WORD + && unit <= MIN (align, BIGGEST_ALIGNMENT) + && (largest_mode == VOIDmode + || unit <= GET_MODE_BITSIZE (largest_mode))) + wide_mode = tmode; + } + + if (wide_mode != VOIDmode) + return wide_mode; + } return mode; } |