public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug c/17614] New: Integer Division produces a Floating exception. @ 2004-09-22 15:59 ppelissi at caramail dot com 2004-09-22 16:00 ` [Bug c/17614] long double / -mfp-rounding-mode=d ppelissi at caramail dot com ` (2 more replies) 0 siblings, 3 replies; 4+ messages in thread From: ppelissi at caramail dot com @ 2004-09-22 15:59 UTC (permalink / raw) To: gcc-bugs The following program: int main() { long double d, e; d = 1.0; while ((e = d / 2.0) != (long double) 0.0) d = e; return 0; } loops forever if it is compiled without optimization: spe149.testdrive.hp.com> /tmp/make/bin/gcc test4.c -mfp-rounding-mode=d -mieee-with-inexact spe149.testdrive.hp.com> time ./a.out ^C0.405u 4.378s 0:04.79 99.5% 10+174k 0+0io 0pf+0w spe149.testdrive.hp.com> /tmp/make/bin/gcc test4.c -mfp-rounding-mode=d -mieee-with-inexact -O2 spe149.testdrive.hp.com> time ./a.out 0.000u 0.004s 0:00.00 0.0% 0+0k 0+0io 0pf+0w spe149.testdrive.hp.com> /tmp/make/bin/gcc -v Reading specs from /tmp/make/lib/gcc/alpha-unknown-freebsd5.2.1/3.4.2/specs Configured with: ./configure --prefix=/tmp/gcc : (reconfigured) ./configure --prefix=/tmp/gcc : (reconfigured) ./configure --prefix=/tmp/make --enable-languages=c Thread model: posix gcc version 3.4.2 The same problem appears with GCC 3.3.3 [FreeBSD] 20031106 -- Summary: Integer Division produces a Floating exception. Product: gcc Version: 3.4.2 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: ppelissi at caramail dot com CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: alpha-unknown-freebsd5.2.1 GCC host triplet: alpha-unknown-freebsd5.2.1 GCC target triplet: alpha-unknown-freebsd5.2.1 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17614 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c/17614] long double / -mfp-rounding-mode=d 2004-09-22 15:59 [Bug c/17614] New: Integer Division produces a Floating exception ppelissi at caramail dot com @ 2004-09-22 16:00 ` ppelissi at caramail dot com 2004-09-22 17:32 ` [Bug target/17614] long double / -mfp-rounding-mode=d-mieee-with-inexact pinskia at gcc dot gnu dot org 2004-09-22 18:06 ` [Bug target/17614] long double / -mfp-rounding-mode=d -mieee-with-inexact pinskia at gcc dot gnu dot org 2 siblings, 0 replies; 4+ messages in thread From: ppelissi at caramail dot com @ 2004-09-22 16:00 UTC (permalink / raw) To: gcc-bugs -mieee-with-inexact X-Bugzilla-Reason: CC -- What |Removed |Added ---------------------------------------------------------------------------- Summary|Integer Division produces a |long double / -mfp-rounding- |Floating exception. |mode=d http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17614 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug target/17614] long double / -mfp-rounding-mode=d-mieee-with-inexact 2004-09-22 15:59 [Bug c/17614] New: Integer Division produces a Floating exception ppelissi at caramail dot com 2004-09-22 16:00 ` [Bug c/17614] long double / -mfp-rounding-mode=d ppelissi at caramail dot com @ 2004-09-22 17:32 ` pinskia at gcc dot gnu dot org 2004-09-22 18:06 ` [Bug target/17614] long double / -mfp-rounding-mode=d -mieee-with-inexact pinskia at gcc dot gnu dot org 2 siblings, 0 replies; 4+ messages in thread From: pinskia at gcc dot gnu dot org @ 2004-09-22 17:32 UTC (permalink / raw) To: gcc-bugs -- What |Removed |Added ---------------------------------------------------------------------------- Component|c |target Summary|long double / -mfp-rounding-|long double / -mfp-rounding- |mode=d |mode=d-mieee-with-inexact http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17614 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug target/17614] long double / -mfp-rounding-mode=d -mieee-with-inexact 2004-09-22 15:59 [Bug c/17614] New: Integer Division produces a Floating exception ppelissi at caramail dot com 2004-09-22 16:00 ` [Bug c/17614] long double / -mfp-rounding-mode=d ppelissi at caramail dot com 2004-09-22 17:32 ` [Bug target/17614] long double / -mfp-rounding-mode=d-mieee-with-inexact pinskia at gcc dot gnu dot org @ 2004-09-22 18:06 ` pinskia at gcc dot gnu dot org 2 siblings, 0 replies; 4+ messages in thread From: pinskia at gcc dot gnu dot org @ 2004-09-22 18:06 UTC (permalink / raw) To: gcc-bugs ------- Additional Comments From pinskia at gcc dot gnu dot org 2004-09-22 18:06 ------- Well it should as you used -mfp-rounding-mode=d Dynamic rounding mode. A field in the floating point control register (fpcr, see Alpha architecture reference manual) controls the rounding mode in effect. The C library initializes this register for rounding towards plus infinity. Thus, unless your program modifies the fpcr, d corresponds to round towards plus infinity. Since you are rounding towards postive infinity you will never reach zero. -- What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |INVALID Summary|long double / -mfp-rounding-|long double / -mfp-rounding- |mode=d-mieee-with-inexact |mode=d -mieee-with-inexact http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17614 ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-09-22 18:06 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2004-09-22 15:59 [Bug c/17614] New: Integer Division produces a Floating exception ppelissi at caramail dot com 2004-09-22 16:00 ` [Bug c/17614] long double / -mfp-rounding-mode=d ppelissi at caramail dot com 2004-09-22 17:32 ` [Bug target/17614] long double / -mfp-rounding-mode=d-mieee-with-inexact pinskia at gcc dot gnu dot org 2004-09-22 18:06 ` [Bug target/17614] long double / -mfp-rounding-mode=d -mieee-with-inexact pinskia at gcc dot gnu dot 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).