Small problem in gen_lowpart_common in emit_rtl.c
Christian Iseli
chris@lslsun.epfl.ch
Tue Sep 2 07:46:00 GMT 1997
I've had problems when GCC was taking a subword of some larger data.
I have a big endian machine, with a word unit of 8 bits. I think I've
tracked down the problem to the gen_lowpart_common function in emit_rtl.c
which forgets which particular sub-word we are interested in. Below is my
proposed fix,
Cheers,
Christian
*** emit-rtl.c.orig Mon Aug 11 17:57:06 1997
--- emit-rtl.c Mon Sep 1 13:53:41 1997
*************** gen_lowpart_common (mode, x)
*** 664,670 ****
|| GET_MODE_SIZE (mode) == GET_MODE_UNIT_SIZE (GET_MODE (x))))
return (GET_MODE (SUBREG_REG (x)) == mode && SUBREG_WORD (x) == 0
? SUBREG_REG (x)
! : gen_rtx (SUBREG, mode, SUBREG_REG (x), SUBREG_WORD (x)));
else if (GET_CODE (x) == REG)
{
/* If the register is not valid for MODE, return 0. If we don't
--- 664,670 ----
|| GET_MODE_SIZE (mode) == GET_MODE_UNIT_SIZE (GET_MODE (x))))
return (GET_MODE (SUBREG_REG (x)) == mode && SUBREG_WORD (x) == 0
? SUBREG_REG (x)
! : gen_rtx (SUBREG, mode, SUBREG_REG (x), SUBREG_WORD (x) + word));
else if (GET_CODE (x) == REG)
{
/* If the register is not valid for MODE, return 0. If we don't
More information about the Gcc
mailing list