This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/17614] New: Integer Division produces a Floating exception.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]