public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: "Mattias Engdegård" <mattias@virtutech.se>
To: geoffk@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org,
Subject: Re: target/3920: wrong register number for CTR in stabs
Date: Mon, 24 Jun 2002 05:36:00 -0000	[thread overview]
Message-ID: <20020624100601.20479.qmail@sources.redhat.com> (raw)

The following reply was made to PR target/3920; it has been noted by GNATS.

From: "=?ISO-8859-1?Q?Mattias Engdeg=E5rd?=" <mattias@virtutech.se>
To: geoffk@redhat.com
Cc: rth@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org,
   geoffk@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Subject: Re: target/3920: wrong register number for CTR in stabs
Date: Mon, 24 Jun 2002 12:02:53 +0200

 >Why do you think this is incorrect?  The assembler code generated by
 >GCC 3.1 with -O2 -g -mregnames is:
 [...]
 >.L9:
 >        add %r0,%r0,%r3
 >        addi %r3,%r3,-1
 >        bdnz .L9
 
 You are right of course. Gcc 2.95 didn't use an integer register that
 worked in parallel with CTR and would instead do a mfctr in the loop
 (which is less efficient of course), so I was confused in my reporting.
 Sorry about that.
 
 A better example would be
 
 int sum(int n)
 {
         int i, j = 0, s = 0;
         for(i = n; i != 0; i--) {
 		s += j;
 		j *= 2;
 	}
         return s;
 }
 
 the loop of which gcc 3.0.2 (I didn't have 3.1 handy) turns into the nice code
 
 .L8:
         add %r3,%r3,%r0
         slwi %r0,%r0,1
         bdnz .L8
 
 but where the stabs claim 'i' lives in register 66, which does not make sense
 for CTR. The DWARF2 output (compiling with -gdwarf-2) seems to use the same
 incorrect numbering.
 
 I will check 3.1 as soon as I have built it.
 


             reply	other threads:[~2002-06-24 10:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-24  5:36 Mattias Engdegård [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-06-21  1:16 Geoff Keating
2002-06-20 16:59 rth
2001-08-03  4:46 mattias

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=20020624100601.20479.qmail@sources.redhat.com \
    --to=mattias@virtutech.se \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=geoffk@gcc.gnu.org \
    /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).