public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Sandiford <rdsandiford@googlemail.com>
To: "Maciej W. Rozycki" <macro@codesourcery.com>
Cc: Steve Ellcey <sellcey@mips.com>,  <gcc-patches@gcc.gnu.org>
Subject: Re: MIPS tests (nan-legacy.c and nans-legacy.c) failing
Date: Tue, 13 Aug 2013 17:25:00 -0000	[thread overview]
Message-ID: <87ioz9iju3.fsf@talisman.default> (raw)
In-Reply-To: <alpine.DEB.1.10.1308130002260.8514@tp.orcam.me.uk> (Maciej	W. Rozycki's message of "Tue, 13 Aug 2013 14:28:34 +0100")

"Maciej W. Rozycki" <macro@codesourcery.com> writes:
>  I've had a look now and that is related to the width of `long' on the 
> host -- encode_ieee_double returns its output 32-bit bit patterns in a 
> buffer of signed longs.  The arithmetic value of these patterns therefore 
> depends on whether the width of `long' is 32 bits or wider.
>
>  Here, in the case of nan-legacy.c, we have:
>
> image_hi <- 0x7ff7ffff
> image_lo <- 0xffffffff
>
> so the returned pair of long values will be:
>
> 2146959359, -1
>
> on a host where the width of `long' is 32 bits and:
>
> 2146959359, 4294967295
>
> on a host where the width of `long' is 64 bits.  Then when supplied as the 
> argument to the assembly-language .word pseudo-op, the two sets of values 
> produce the same bit patterns in the object file produced.
>
>  It's not clear to me if this dependency on the width of `long' is a bug 
> or feature, but a path-of-least-resistance fix is as follows.

IMO a bug.  If we're sure 32 bits is enough then we should use "int".
If we're not sure we should use HOST_WIDE_INT.  The only thing using
"long" is going to do is create this kind of weird host dependence.

I can't argue with the path of least resistance though.

> 2013-08-13  Maciej W. Rozycki  <macro@codesourcery.com>
>
> 	gcc/testsuite/
> 	* gcc.target/mips/nan-legacy.c: Accept 4294967295 as an 
> 	alternative to -1.
> 	* gcc.target/mips/nans-legacy.c: Likewise.

OK, thanks.

Richard

  parent reply	other threads:[~2013-08-13 17:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-30 23:27 Steve Ellcey 
2013-08-07 20:20 ` Richard Sandiford
2013-08-13 13:28   ` Maciej W. Rozycki
2013-08-13 16:49     ` Steve Ellcey
2013-08-13 17:25     ` Richard Sandiford [this message]
2013-08-13 21:53       ` Maciej W. Rozycki

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=87ioz9iju3.fsf@talisman.default \
    --to=rdsandiford@googlemail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=macro@codesourcery.com \
    --cc=sellcey@mips.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).