public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Small problem in gen_lowpart_common in emit_rtl.c
@ 1997-09-02  7:46 Christian Iseli
  1997-09-07 12:04 ` Jeffrey A Law
  1997-09-10 15:04 ` Jim Wilson
  0 siblings, 2 replies; 4+ messages in thread
From: Christian Iseli @ 1997-09-02  7:46 UTC (permalink / raw)
  To: egcs

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Small problem in gen_lowpart_common in emit_rtl.c
  1997-09-02  7:46 Small problem in gen_lowpart_common in emit_rtl.c Christian Iseli
@ 1997-09-07 12:04 ` Jeffrey A Law
  1997-09-10 15:04 ` Jim Wilson
  1 sibling, 0 replies; 4+ messages in thread
From: Jeffrey A Law @ 1997-09-07 12:04 UTC (permalink / raw)
  To: Christian Iseli; +Cc: egcs

  In message < 199709021445.QAA23459@lslsun17.epfl.ch >you write:
  > 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,
I believe your patch is probably correct.  However, can you provide
a little more info so that I can understand exactly what's happening?

Specifically, what are MODE and X upon entry and what is the basic word size
on your machine?

Thanks,
jeff

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Small problem in gen_lowpart_common in emit_rtl.c
  1997-09-02  7:46 Small problem in gen_lowpart_common in emit_rtl.c Christian Iseli
  1997-09-07 12:04 ` Jeffrey A Law
@ 1997-09-10 15:04 ` Jim Wilson
  1 sibling, 0 replies; 4+ messages in thread
From: Jim Wilson @ 1997-09-10 15:04 UTC (permalink / raw)
  To: Christian Iseli; +Cc: egcs

I checked in this change.

Jim

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Small problem in gen_lowpart_common in emit_rtl.c
@ 1997-09-09  6:50 Christian Iseli
  0 siblings, 0 replies; 4+ messages in thread
From: Christian Iseli @ 1997-09-09  6:50 UTC (permalink / raw)
  To: law; +Cc: egcs

> I believe your patch is probably correct.  However, can you provide
> a little more info so that I can understand exactly what's happening?
> 
> Specifically, what are MODE and X upon entry and what is the basic word size
> on your machine?

The word size of my machine is eight bit, i.e., BITS_PER_UNIT is 8 and
UNITS_PER_WORD is 1, BYTES_BIG_ENDIAN and WORDS_BIG_ENDIAN are both true.

Here is a typical example: gen_lowpart_common(mode, x) is called with
mode = QImode and x = (subreg:HI (reg/v:SI 31) 2).  The result I expect
is (subreg:QI (reg/v:SI 31) 3), but without the patch the result I get
is (subreg:QI (reg/v:SI 31) 2), which is obviously wrong...

					Christian

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1997-09-10 15:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-09-02  7:46 Small problem in gen_lowpart_common in emit_rtl.c Christian Iseli
1997-09-07 12:04 ` Jeffrey A Law
1997-09-10 15:04 ` Jim Wilson
1997-09-09  6:50 Christian Iseli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).