public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/60528] MIPS GCC puts out complex constant incorrectly when in big-endian mode
       [not found] <bug-60528-4@http.gcc.gnu.org/bugzilla/>
@ 2014-03-18 16:42 ` sje at gcc dot gnu.org
  2014-03-19 21:05 ` sje at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: sje at gcc dot gnu.org @ 2014-03-18 16:42 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60528

--- Comment #1 from Steve Ellcey <sje at gcc dot gnu.org> ---
An additional data point, If I build a MIPS cross compiler as a 32 bit x86
object then it does the right thing, if I build the cross compiler as a 64 bit
object then I get incorrect results.  The 4.8.1 compiler I was testing was
built as a 32 bit object so this bug may not be a regression from 4.8 but a
long standing bug involving building the MIPS compiler in 64 bit mode.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/60528] MIPS GCC puts out complex constant incorrectly when in big-endian mode
       [not found] <bug-60528-4@http.gcc.gnu.org/bugzilla/>
  2014-03-18 16:42 ` [Bug target/60528] MIPS GCC puts out complex constant incorrectly when in big-endian mode sje at gcc dot gnu.org
@ 2014-03-19 21:05 ` sje at gcc dot gnu.org
  2014-03-19 21:20 ` rsandifo at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: sje at gcc dot gnu.org @ 2014-03-19 21:05 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60528

--- Comment #2 from Steve Ellcey <sje at gcc dot gnu.org> ---
This may actually be a glibc bug instead of a GCC bug.  While GCC puts out
different numbers based on whether or not it is built as a 32 or 64 bit object
(and I think that is a bug) that does not seem to be causing the csinh failure.

Both '.word' entries, '3624173458' and '-670793838' get assembled into the same
bit string in the object file so even though the .s files look different, the
.o files are identical.

FYI:

The reason GCC is putting out different values based on whether or not it is a
32 bit object or a 64 bit object is due to code in encode_ieee_double. It
encodes the value into image_lo and image_hi, which are 'unsigned long' but it
only fills in the 'bottom' 32 bits of these variables even if they are 64 bits
in size.  If this includes setting the bit that would be the sign bit on a 32
bit long then we wind up with a negative number on a system with 32 bit longs
and a positive number on a system with 64 bit longs when we copy the values to
buf (which is a signed long type).


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/60528] MIPS GCC puts out complex constant incorrectly when in big-endian mode
       [not found] <bug-60528-4@http.gcc.gnu.org/bugzilla/>
  2014-03-18 16:42 ` [Bug target/60528] MIPS GCC puts out complex constant incorrectly when in big-endian mode sje at gcc dot gnu.org
  2014-03-19 21:05 ` sje at gcc dot gnu.org
@ 2014-03-19 21:20 ` rsandifo at gcc dot gnu.org
  2014-03-20 17:29 ` sje at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: rsandifo at gcc dot gnu.org @ 2014-03-19 21:20 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60528

--- Comment #3 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> ---
Agree about 'unsigned long'.  IMO we shouldn't use 'long' directly
in GCC; it should be one of 'int', 'HOST_WIDE_INT' or 'HOST_WIDEST_INT'.

FWIW the test passes for me on mips64-linux-gnu on all three ABIs.
I'm using glibc f8d529d5199ef7575dae9f8e1909139cf429c1e2 compiled
by a recentish 4.9 --with-arch=mips64 --with-mips-plt gcc.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/60528] MIPS GCC puts out complex constant incorrectly when in big-endian mode
       [not found] <bug-60528-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2014-03-19 21:20 ` rsandifo at gcc dot gnu.org
@ 2014-03-20 17:29 ` sje at gcc dot gnu.org
  2015-02-10  6:27 ` [Bug middle-end/60528] GCC puts out floating point constants differently depending on if long is 32bit or 64bit (encode_ieee_double) pinskia at gcc dot gnu.org
  2024-03-17  7:42 ` [Bug middle-end/60528] GCC puts out floating point constants differently depending on if long is 32bit or 64bit (due to use of long for encode_ieee_double) pinskia at gcc dot gnu.org
  5 siblings, 0 replies; 6+ messages in thread
From: sje at gcc dot gnu.org @ 2014-03-20 17:29 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60528

--- Comment #4 from Steve Ellcey <sje at gcc dot gnu.org> ---
I have created a new bug for the incorrect csinh results and included a cutdown
test case.  It looks like a GCC optimization bug.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60604

I think this bug should stay open as a defect in that GCC should print out the
same output regardless of whether the compiler itself was built as a 32 bit
executable or as a 64 bit executable.  It does not and while that turned out
not to be the cause of my test failure but it is still wrong.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug middle-end/60528] GCC puts out floating point constants differently depending on if long is 32bit or 64bit (encode_ieee_double)
       [not found] <bug-60528-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2014-03-20 17:29 ` sje at gcc dot gnu.org
@ 2015-02-10  6:27 ` pinskia at gcc dot gnu.org
  2024-03-17  7:42 ` [Bug middle-end/60528] GCC puts out floating point constants differently depending on if long is 32bit or 64bit (due to use of long for encode_ieee_double) pinskia at gcc dot gnu.org
  5 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2015-02-10  6:27 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60528

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|target                      |middle-end
            Version|unknown                     |4.9.0
            Summary|MIPS GCC puts out complex   |GCC puts out floating point
                   |constant incorrectly when   |constants differently
                   |in big-endian mode          |depending on if long is
                   |                            |32bit or 64bit
                   |                            |(encode_ieee_double)
           Severity|normal                      |trivial


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug middle-end/60528] GCC puts out floating point constants differently depending on if long is 32bit or 64bit (due to use of long for encode_ieee_double)
       [not found] <bug-60528-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2015-02-10  6:27 ` [Bug middle-end/60528] GCC puts out floating point constants differently depending on if long is 32bit or 64bit (encode_ieee_double) pinskia at gcc dot gnu.org
@ 2024-03-17  7:42 ` pinskia at gcc dot gnu.org
  5 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-17  7:42 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60528

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
            Summary|GCC puts out floating point |GCC puts out floating point
                   |constants differently       |constants differently
                   |depending on if long is     |depending on if long is
                   |32bit or 64bit              |32bit or 64bit (due to use
                   |(encode_ieee_double)        |of long for
                   |                            |encode_ieee_double)
   Last reconfirmed|                            |2024-03-17
             Status|UNCONFIRMED                 |NEW

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-03-17  7:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-60528-4@http.gcc.gnu.org/bugzilla/>
2014-03-18 16:42 ` [Bug target/60528] MIPS GCC puts out complex constant incorrectly when in big-endian mode sje at gcc dot gnu.org
2014-03-19 21:05 ` sje at gcc dot gnu.org
2014-03-19 21:20 ` rsandifo at gcc dot gnu.org
2014-03-20 17:29 ` sje at gcc dot gnu.org
2015-02-10  6:27 ` [Bug middle-end/60528] GCC puts out floating point constants differently depending on if long is 32bit or 64bit (encode_ieee_double) pinskia at gcc dot gnu.org
2024-03-17  7:42 ` [Bug middle-end/60528] GCC puts out floating point constants differently depending on if long is 32bit or 64bit (due to use of long for encode_ieee_double) pinskia at gcc dot gnu.org

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).