public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ian Lance Taylor <ian@airs.com>
To: Sanjiv Kumar Gupta <sanjiv.gupta@oracle.com>
Cc: Sanjiv Kumar Gupta <skgnu@yahoo.com>, gcc@gcc.gnu.org
Subject: Re: GCC 3.3.1 -O2 problem with sqrt.c
Date: Sat, 04 Jun 2005 02:58:00 -0000	[thread overview]
Message-ID: <m34qce6d5v.fsf@gossamer.airs.com> (raw)
In-Reply-To: <429B1B23.8070301@oracle.com>

Sanjiv Kumar Gupta <sanjiv.gupta@oracle.com> writes:

> >>I couldn't understand why the insns 620 and 621 are
> >>being generated here as DI moves.
> > I'm not sure specifically why it got a DI move here, but it doesn't
> > look wrong.  It's treating the struct named parts as DImode.
> >
> >>This is creating problem since insn 621 gets splitted
> >>after reload into two SI moves,i.e. @(r21, -8) and
> >>@(r21, -4).
> >>This renders insns 619 as dead and hence insns 618 and
> >>insn 429 as dead, which are eliminated by flow2.
> > It does look rather suspicious, but it's hard to know whether it is
> > wrong without seeing the value in r1.
> >
> r1 looks unrelated to struct members, and is being used by the
> ifcvt pass to expand some comparison insns.

In your .23 file, this is insn 431:

(insn 431 430 432 39 0x1002f420 (set (subreg:SI (reg/v:DI 153) 0)
        (reg/v:SI 77)) 6 {*movsi} (insn_list 429 (nil))
    (expr_list:REG_DEAD (reg/v:SI 77)
        (nil)))

So it is setting the first SI subreg of a DI value.  reload decides to
do an output reload for register 153.  Since register 153 is DImode,
it does a DImode reload.

It winds up copying the DImode value to r2, and then writing r2 to
memory.  The double move is because there is a secondary reload
involved.  That implies that SECONDARY_OUTPUT_RELOAD_CLASS is defined
and is returning something other than NO_REGS for this case.

I see that insn 429 is setting the high part of register 153.  Insn
429 looks like this:

(insn 429 428 430 39 0x1002f420 (set (subreg:SI (reg/v:DI 153) 4)
        (plus:SI (reg/v:SI 79)
            (reg/v:SI 82))) 12 {addsi3} (insn_list 422 (nil))
    (expr_list:REG_DEAD (reg/v:SI 82)
        (expr_list:REG_DEAD (reg/v:SI 79)
            (nil))))

But note that a set to a subreg is explicitly defined to set the other
parts of the register to garbage.  Therefore the value set by insn 429
is destroyed by insn 431.

I would guess that you need a strict_low_part in insns 429 and 431.
See the RTL documentation.

Ian

  parent reply	other threads:[~2005-06-04  2:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-27 13:42 Sanjiv Kumar Gupta
2005-05-27 17:49 ` Ian Lance Taylor
2005-05-30 15:28   ` Sanjiv Kumar Gupta
2005-05-31 12:13     ` Sanjiv Kumar Gupta
2005-05-30 15:28   ` Sanjiv Kumar Gupta
2005-06-02 13:19     ` Dave Korn
2005-06-04  2:58     ` Ian Lance Taylor [this message]
2005-06-17 12:55       ` Sanjiv Kumar Gupta

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=m34qce6d5v.fsf@gossamer.airs.com \
    --to=ian@airs.com \
    --cc=gcc@gcc.gnu.org \
    --cc=sanjiv.gupta@oracle.com \
    --cc=skgnu@yahoo.com \
    /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).