diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2018-01-11 09:54:26 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2018-01-11 09:54:26 +0000 |
commit | 69a350853900f6b6f9775deb95efff942020a55f (patch) | |
tree | fdf45f7f4b6748489423ba58b083abd8a70b75a9 | |
parent | fab588529a9605df33ca25a97f5b0e7c56f6c3be (diff) | |
download | gcc-69a350853900f6b6f9775deb95efff942020a55f.zip gcc-69a350853900f6b6f9775deb95efff942020a55f.tar.gz gcc-69a350853900f6b6f9775deb95efff942020a55f.tar.bz2 |
Fix mode_for_size units in caller-save.c (PR83761)
The new opt_mode asserts triggered for replace_reg_with_saved_mem
because it was passing bytes rather than bits to mode_for_size.
Previously we ended up with a BLKmode register instead, but
presumably that didn't matter because this is "only" used for
debug insns.
2018-01-11 Richard Sandiford <richard.sandiford@linaro.org>
gcc/
PR rtl-optimization/83761
* caller-save.c (replace_reg_with_saved_mem): Pass bits rather
than bytes to mode_for_size.
From-SVN: r256525
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/caller-save.c | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3265272..9e5f46a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-01-11 Richard Sandiford <richard.sandiford@linaro.org> + + PR rtl-optimization/83761 + * caller-save.c (replace_reg_with_saved_mem): Pass bits rather + than bytes to mode_for_size. + 2018-01-10 Jan Hubicka <hubicka@ucw.cz> PR middle-end/83189 diff --git a/gcc/caller-save.c b/gcc/caller-save.c index 524de49..df1c969 100644 --- a/gcc/caller-save.c +++ b/gcc/caller-save.c @@ -1147,7 +1147,8 @@ replace_reg_with_saved_mem (rtx *loc, machine_mode smode = save_mode[regno]; gcc_assert (smode != VOIDmode); if (hard_regno_nregs (regno, smode) > 1) - smode = mode_for_size (exact_div (GET_MODE_SIZE (mode), nregs), + smode = mode_for_size (exact_div (GET_MODE_BITSIZE (mode), + nregs), GET_MODE_CLASS (mode), 0).require (); XVECEXP (mem, 0, i) = gen_rtx_REG (smode, regno + i); } |