public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Joern Rennecke <amylaar@redhat.com>
To: thomascanny@yahoo.co.nz (thomas joseph)
Cc: gcc@gcc.gnu.org
Subject: Re: SUBREG problems
Date: Wed, 19 Sep 2001 21:44:00 -0000	[thread overview]
Message-ID: <200109200444.f8K4iLu13253@phal.cambridge.redhat.com> (raw)
In-Reply-To: <20010905135700.63960.qmail@web14708.mail.yahoo.com>

> 
> 
> Hi ALL
>  I am working for a new gcc port.I have a small
> problem
>  with subregs. I am still to confirm whether this
> problem is addressed by some body or not.
> 
>   On my machine the UNITS_PER_WORD is 2 and I made
> longs as 32 bits. So, when they are in registers they 
>  need two consecutive registers. I am doing this.
> 
>   ALl the opeartions on the machine are 16bit. So, I
> am
> splitting the long operations in to two 16 bit
> operations.
> 
>    The problem is with the compare and branch
> operations.....
> 
>  I have a test program ......
> 
>    int main ()
>    {
>      register long x = 10;
> 
>      if (x == 10)
>        return 0;
>       else
>        return 1;
>    }
> 
>   Here the problem is when  I access the low part and
>  high parts of op for my cmp/branch operations 
>   the look like
> 
> insn 10 8 11 (set (cc0)
>         (compare (subreg:HI (reg/v:SI 53) 0)
>             (const_int 0 [0x0]))) 15 {cmphi_1} (nil)
>     (nil))
> 
>  
> (insn 12 11 13 (set (cc0)
>         (compare (subreg:HI (reg/v:SI 53) 1)
>             (const_int 10 [0xa]))) 15 {cmphi_1} (nil)
>     (nil))
> 
> 
> . When they end up in memory both subregs refer to the
> 
>  low parts only. if x is at (ix -4), both refer to (ix
> -4) to (ix -2) only. I do n't know where it is going
> wrong.......
> 
>   Do I need to add some thing in the gen_lowpart and
> gen_highpart ??
> 
> 
>  Could some body point me at the right place where to
> look for this problem.......

As you start out with a pseudo register, I would expect the stack slot
allocation to be done from alter_reg.  You could set a breakpoint
there and compare before / after dumps for insns 10 and 12.  For that
matter, it seems surprising that the only user level variable would
be spilled; or are you actually using a lager testcase?

Anyways, if youare using gdb on a host where it supports hardware
watchpoints, there is also another technique that allows you to find
out where things go wrong:
print &cfun->emit->x_regno_reg_rtx[53]->code
and set a hardware watchpoint on the dereferenced address to see where
the pseudo is spilled.  Likewise, you can set hardware watchpoints to
find out where particular pieces of rtl in the insn stream are altered.

      reply	other threads:[~2001-09-19 21:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-05  6:57 thomas joseph
2001-09-19 21:44 ` Joern Rennecke [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200109200444.f8K4iLu13253@phal.cambridge.redhat.com \
    --to=amylaar@redhat.com \
    --cc=gcc@gcc.gnu.org \
    --cc=thomascanny@yahoo.co.nz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).