diff options
author | Richard Sandiford <rdsandiford@googlemail.com> | 2012-01-31 19:11:00 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2012-01-31 19:11:00 +0000 |
commit | 35aebd56353ee7aec7a17155689dd473ee48ded4 (patch) | |
tree | 708bf63d2bd26659c34ffa475438467490e03be7 /gcc | |
parent | 218e1228c941cf0e1669610eaf33fdf5c010c3c0 (diff) | |
download | gcc-35aebd56353ee7aec7a17155689dd473ee48ded4.zip gcc-35aebd56353ee7aec7a17155689dd473ee48ded4.tar.gz gcc-35aebd56353ee7aec7a17155689dd473ee48ded4.tar.bz2 |
function.h (regno_reg_rtx): Adjust comment.
gcc/
* function.h (regno_reg_rtx): Adjust comment.
* reginfo.c (init_reg_modes_target): Only use the previous mode
if it fits within one register. Remove MIPS comment.
From-SVN: r183773
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/function.h | 11 | ||||
-rw-r--r-- | gcc/reginfo.c | 14 |
3 files changed, 21 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 64ec003..ef9fb3d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2012-01-31 Richard Sandiford <rdsandiford@googlemail.com> + + * function.h (regno_reg_rtx): Adjust comment. + * reginfo.c (init_reg_modes_target): Only use the previous mode + if it fits within one register. Remove MIPS comment. + 2012-01-31 Jakub Jelinek <jakub@redhat.com> PR bootstrap/52058 diff --git a/gcc/function.h b/gcc/function.h index ce67add..5aaba74 100644 --- a/gcc/function.h +++ b/gcc/function.h @@ -87,10 +87,13 @@ struct GTY(()) emit_status { }; -/* Indexed by pseudo register number, gives the rtx for that pseudo. - Allocated in parallel with regno_pointer_align. - FIXME: We could put it into emit_status struct, but gengtype is not able to deal - with length attribute nested in top level structures. */ +/* Indexed by register number, gives an rtx for that register (and only + that register). For pseudo registers, it is the unique rtx for + that pseudo. For hard registers, it is an rtx of the mode specified + by reg_raw_mode. + + FIXME: We could put it into emit_status struct, but gengtype is not + able to deal with length attribute nested in top level structures. */ extern GTY ((length ("crtl->emit.x_reg_rtx_no"))) rtx * regno_reg_rtx; diff --git a/gcc/reginfo.c b/gcc/reginfo.c index f6f91a9..6353126 100644 --- a/gcc/reginfo.c +++ b/gcc/reginfo.c @@ -615,13 +615,15 @@ init_reg_modes_target (void) { reg_raw_mode[i] = choose_hard_reg_mode (i, 1, false); - /* If we couldn't find a valid mode, just use the previous mode. - ??? One situation in which we need to do this is on the mips where - HARD_REGNO_NREGS (fpreg, [SD]Fmode) returns 2. Ideally we'd like - to use DF mode for the even registers and VOIDmode for the odd - (for the cpu models where the odd ones are inaccessible). */ + /* If we couldn't find a valid mode, just use the previous mode + if it is suitable, otherwise fall back on word_mode. */ if (reg_raw_mode[i] == VOIDmode) - reg_raw_mode[i] = i == 0 ? word_mode : reg_raw_mode[i-1]; + { + if (i > 0 && hard_regno_nregs[i][reg_raw_mode[i - 1]] == 1) + reg_raw_mode[i] = reg_raw_mode[i - 1]; + else + reg_raw_mode[i] = word_mode; + } } } |