From e1a4071f3ad63741e3e8616e8e0507de15b47b62 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Mon, 28 Nov 1994 22:45:16 -0700 Subject: [PATCH] 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 --- gcc/explow.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/gcc/explow.c b/gcc/explow.c index b72e468e050..78e379716de 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 -- 2.30.2