public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jim Wilson <wilson@cygnus.com>
To: hjl@lucon.org (H.J. Lu)
Cc: law@cygnus.com, scox@cygnus.com,
	crux@pool.informatik.rwth-aachen.de, egcs@cygnus.com
Subject: Re: More fp bug in egcs
Date: Sun, 03 May 1998 20:10:00 -0000	[thread overview]
Message-ID: <199805032246.PAA08295@rtl.cygnus.com> (raw)
In-Reply-To: <m0yVnEy-000268C@ocean.lucon.org>

	Here is the trimmed down test case. I am not sure if your patch is
	correct. If you take look at the stack RTL dump, you will see SF 1 in
	is used as the input for the next insn:

It is supposed to be used by the next instruction.  This is the output reload
that copies the input/output value to the stack slot where it lives.  However,
since this value is dead, it will never be read from the stack slot, and hence
it doesn't matter what this value is.

The only problem here is that the code is inefficient, but since this case
can only happen when not optimized, this is not a problem.

	I don't know if it is correct. Did gcc know %st(0) was not the same
	%st(0) before?

Yes, gcc knows that %st(0) was clobbered.  This is why the following
instruction is storing the clobbered value back to the stack slot where it
lives.

When considering how to fix this bug, it is important to separate what the
RTL means from what the actual x86 FP instructions are.  My patch fixes the
problem by synthesizing a missing instruction.  This is a perfectly valid thing
to do.  This is no different than using two 4-byte loads to make a 8-byte load.
It is just a bit harder to understand because the FP stack is involved.

Jim


  reply	other threads:[~1998-05-03 20:10 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-04-25 18:25 H.J. Lu
1998-04-27 21:29 ` Jim Wilson
1998-04-30 20:03 ` Jim Wilson
1998-05-02 18:56   ` H.J. Lu
1998-05-03 20:10     ` Jim Wilson [this message]
1998-05-05  0:35     ` Jeffrey A Law
1998-05-05 19:14       ` H.J. Lu
1998-05-06 11:49         ` Jim Wilson
1998-05-05  5:03   ` Jeffrey A Law
1998-05-06 17:12   ` A patch for PPro H.J. Lu
1998-05-06 18:14     ` Jeffrey A Law
1998-05-07 15:31     ` Jim Wilson
1998-05-03  0:55 More fp bug in egcs H.J. Lu
1998-05-03 12:03 ` H.J. Lu
1998-05-03 17:14   ` Jim Wilson
1998-05-04 11:17     ` H.J. Lu
1998-05-04 18:07       ` Jeffrey A Law
1998-05-04 18:07         ` H.J. Lu
1998-05-04 22:00           ` Jeffrey A Law
1998-05-08 16:04           ` Jeffrey A Law
1998-05-03 20:10 ` Jim Wilson
1998-05-05  5:46   ` Jeffrey A Law

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=199805032246.PAA08295@rtl.cygnus.com \
    --to=wilson@cygnus.com \
    --cc=crux@pool.informatik.rwth-aachen.de \
    --cc=egcs@cygnus.com \
    --cc=hjl@lucon.org \
    --cc=law@cygnus.com \
    --cc=scox@cygnus.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).