diff options
author | Jeff Law <law@gcc.gnu.org> | 1994-11-28 22:45:16 -0700 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1994-11-28 22:45:16 -0700 |
commit | e1a4071f3ad63741e3e8616e8e0507de15b47b62 (patch) | |
tree | 695a4e5841a1cc4fecfbc358f12339081d066bf4 /gcc/explow.c | |
parent | 4c485b6355ddd88298476ab826e10fa92de20874 (diff) | |
download | gcc-e1a4071f3ad63741e3e8616e8e0507de15b47b62.zip gcc-e1a4071f3ad63741e3e8616e8e0507de15b47b62.tar.gz gcc-e1a4071f3ad63741e3e8616e8e0507de15b47b62.tar.bz2 |
explow.c (hard_function_value): Change a register in BLKmode to a register in a sufficiently wide integer mode.
* explow.c (hard_function_value): Change a register in BLKmode
to a register in a sufficiently wide integer mode.
From-SVN: r8578
Diffstat (limited to 'gcc/explow.c')
-rw-r--r-- | gcc/explow.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/gcc/explow.c b/gcc/explow.c index b72e468..78e3797 100644 --- a/gcc/explow.c +++ b/gcc/explow.c @@ -1100,7 +1100,28 @@ hard_function_value (valtype, func) tree valtype; tree func; { - return FUNCTION_VALUE (valtype, func); + rtx val = FUNCTION_VALUE (valtype, func); + if (GET_CODE (val) == REG + && GET_MODE (val) == BLKmode) + { + int bytes = int_size_in_bytes (valtype); + enum machine_mode tmpmode; + for (tmpmode = GET_CLASS_NARROWEST_MODE (MODE_INT); + tmpmode != MAX_MACHINE_MODE; + tmpmode = GET_MODE_WIDER_MODE (tmpmode)) + { + /* Have we found a large enough mode? */ + if (GET_MODE_SIZE (tmpmode) >= bytes) + break; + } + + /* No suitable mode found. */ + if (tmpmode == MAX_MACHINE_MODE) + abort (); + + PUT_MODE (val, tmpmode); + } + return val; } /* Return an rtx representing the register or memory location |