public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/27321] New: Compare against constant infinity fails with IBM long double format
@ 2006-04-26 2:17 dvdfrdmn at users dot sf dot net
2006-04-26 2:27 ` [Bug middle-end/27321] " pinskia at gcc dot gnu dot org
2006-04-30 7:33 ` pinskia at gcc dot gnu dot org
0 siblings, 2 replies; 4+ messages in thread
From: dvdfrdmn at users dot sf dot net @ 2006-04-26 2:17 UTC (permalink / raw)
To: gcc-bugs
Test code:
long double x = __builtin_infl();
int main() {
int r = x == __builtin_infl();
return r ? 0 : 1;
}
Commands to reproduce:
gcc -mlong-double-128 tc.c
./a.out && echo ok || echo fail
No problem with -mlong-double-64.
Cause:
GCC first transforms (x == infinity) to (x > long_double_max_val).
The maximum value returned by real_maxval is encoded as infinity due
to rounding in encode_ibm_extended. This does not happen with the
LDBL_MAX declared in system headers because one of the bits is
cleared.
Potential fix:
--- real.c.orig 2005-09-19 12:56:24.000000000 -0400
+++ real.c 2006-04-25 21:18:32.000000000 -0400
@@ -2205,6 +2205,8 @@ real_maxval (REAL_VALUE_TYPE *r, int sig
np2 = SIGNIFICAND_BITS - fmt->p * fmt->log2_b;
memset (r->sig, -1, SIGSZ * sizeof (unsigned long));
clear_significand_below (r, np2);
+ if (REAL_MODE_FORMAT_COMPOSITE_P (mode))
+ clear_significand_bit (r, SIGNIFICAND_BITS - fmt->pnan - 1);
}
--
Summary: Compare against constant infinity fails with IBM long
double format
Product: gcc
Version: 4.0.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: middle-end
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dvdfrdmn at users dot sf dot net
GCC target triplet: powerpc-apple-darwin8
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27321
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug middle-end/27321] Compare against constant infinity fails with IBM long double format
2006-04-26 2:17 [Bug middle-end/27321] New: Compare against constant infinity fails with IBM long double format dvdfrdmn at users dot sf dot net
@ 2006-04-26 2:27 ` pinskia at gcc dot gnu dot org
2006-04-30 7:33 ` pinskia at gcc dot gnu dot org
1 sibling, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-04-26 2:27 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2006-04-26 02:27 -------
This works in the mainline.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27321
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug middle-end/27321] Compare against constant infinity fails with IBM long double format
2006-04-26 2:17 [Bug middle-end/27321] New: Compare against constant infinity fails with IBM long double format dvdfrdmn at users dot sf dot net
2006-04-26 2:27 ` [Bug middle-end/27321] " pinskia at gcc dot gnu dot org
@ 2006-04-30 7:33 ` pinskia at gcc dot gnu dot org
1 sibling, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-04-30 7:33 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pinskia at gcc dot gnu dot org 2006-04-30 07:33 -------
Actually I am wrong in saying it worked. I usually forget to test the return
value as I assume people use abort to signal a failure.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
GCC target triplet|powerpc-apple-darwin8 |powerpc*-*-*
Keywords| |wrong-code
Last reconfirmed|0000-00-00 00:00:00 |2006-04-30 07:33:00
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27321
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug middle-end/27321] Compare against constant infinity fails with IBM long double format
[not found] <bug-27321-4@http.gcc.gnu.org/bugzilla/>
@ 2012-03-02 19:26 ` bernhard.kaindl at thalesgroup dot com
0 siblings, 0 replies; 4+ messages in thread
From: bernhard.kaindl at thalesgroup dot com @ 2012-03-02 19:26 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27321
Bernhard Kaindl <bernhard.kaindl at thalesgroup dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bernhard.kaindl at
| |thalesgroup dot com
--- Comment #3 from Bernhard Kaindl <bernhard.kaindl at thalesgroup dot com> 2012-03-02 19:25:55 UTC ---
Verification using powerpc-linux-gcc-4.4.6 (--host=i686-linux):
Testcase works, it seems this may be fixed. Suggest closing after soon 6 years.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-03-02 19:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-26 2:17 [Bug middle-end/27321] New: Compare against constant infinity fails with IBM long double format dvdfrdmn at users dot sf dot net
2006-04-26 2:27 ` [Bug middle-end/27321] " pinskia at gcc dot gnu dot org
2006-04-30 7:33 ` pinskia at gcc dot gnu dot org
[not found] <bug-27321-4@http.gcc.gnu.org/bugzilla/>
2012-03-02 19:26 ` bernhard.kaindl at thalesgroup dot com
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).