public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/19904] Division by zero leads to error
       [not found] <bug-19904-7427@http.gcc.gnu.org/bugzilla/>
@ 2006-06-08  1:17 ` jvdelisle at gcc dot gnu dot org
  2006-06-18  6:42 ` jvdelisle at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2006-06-08  1:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jvdelisle at gcc dot gnu dot org  2006-06-08 01:10 -------
This bug is related to 19310


-- 

jvdelisle at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|                            |19310
   Target Milestone|---                         |4.2.0


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


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

* [Bug fortran/19904] Division by zero leads to error
       [not found] <bug-19904-7427@http.gcc.gnu.org/bugzilla/>
  2006-06-08  1:17 ` [Bug fortran/19904] Division by zero leads to error jvdelisle at gcc dot gnu dot org
@ 2006-06-18  6:42 ` jvdelisle at gcc dot gnu dot org
  2006-06-18  9:35 ` [Bug fortran/19904] [4.1 Only] " jvdelisle at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2006-06-18  6:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jvdelisle at gcc dot gnu dot org  2006-06-18 06:42 -------
Subject: Bug 19904

Author: jvdelisle
Date: Sun Jun 18 06:42:26 2006
New Revision: 114753

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=114753
Log:
2006-06-18  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

        PR fortran/19310
        PR fortran/19904
        * gfortran.dg/real_const_3.f90: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/real_const_3.f90
Modified:
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/19904] [4.1 Only] Division by zero leads to error
       [not found] <bug-19904-7427@http.gcc.gnu.org/bugzilla/>
  2006-06-08  1:17 ` [Bug fortran/19904] Division by zero leads to error jvdelisle at gcc dot gnu dot org
  2006-06-18  6:42 ` jvdelisle at gcc dot gnu dot org
@ 2006-06-18  9:35 ` jvdelisle at gcc dot gnu dot org
  2006-06-28  5:40 ` jvdelisle at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2006-06-18  9:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from jvdelisle at gcc dot gnu dot org  2006-06-18 06:49 -------
Fixed on 4.2


-- 

jvdelisle at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Division by zero leads to   |[4.1 Only] Division by zero
                   |error                       |leads to error


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


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

* [Bug fortran/19904] [4.1 Only] Division by zero leads to error
       [not found] <bug-19904-7427@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2006-06-18  9:35 ` [Bug fortran/19904] [4.1 Only] " jvdelisle at gcc dot gnu dot org
@ 2006-06-28  5:40 ` jvdelisle at gcc dot gnu dot org
  2006-06-28  5:41 ` jvdelisle at gcc dot gnu dot org
  2006-06-28  7:51 ` jvdelisle at gcc dot gnu dot org
  5 siblings, 0 replies; 11+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2006-06-28  5:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from jvdelisle at gcc dot gnu dot org  2006-06-28 05:37 -------
Subject: Bug 19904

Author: jvdelisle
Date: Wed Jun 28 05:36:08 2006
New Revision: 115048

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=115048
Log:
2006-06-27  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

        PR fortran/19310
        PR fortran/19904
        * arith.c (gfc_range_check): Return ARITH_OK if -fno-range-check. Add
        return of ARITH_NAN, ARITH_UNDERFLOW, and ARITH_OVERFLOW.
        (gfc_arith_divide): If -fno-range-check allow mpfr to divide by zero.
        * gfortran.h (gfc_option_t): Add new flag.
        * invoke.texi: Document new flag.
        * lang.opt: Add option -frange-check.
        * options.c (gfc_init_options): Initialize new flag.
        (gfc_handle_options): Set flag if invoked.
        * simplify.c (range_check): Add error messages for
        overflow, underflow, and other errors.
        * trans-const.c (gfc_conv_mpfr_to_tree): Build NaN and Inf from mpfr
        result.

Modified:
    branches/gcc-4_1-branch/gcc/fortran/ChangeLog
    branches/gcc-4_1-branch/gcc/fortran/arith.c
    branches/gcc-4_1-branch/gcc/fortran/gfortran.h
    branches/gcc-4_1-branch/gcc/fortran/invoke.texi
    branches/gcc-4_1-branch/gcc/fortran/lang.opt
    branches/gcc-4_1-branch/gcc/fortran/options.c
    branches/gcc-4_1-branch/gcc/fortran/simplify.c
    branches/gcc-4_1-branch/gcc/fortran/trans-const.c


-- 


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


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

* [Bug fortran/19904] [4.1 Only] Division by zero leads to error
       [not found] <bug-19904-7427@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2006-06-28  5:40 ` jvdelisle at gcc dot gnu dot org
@ 2006-06-28  5:41 ` jvdelisle at gcc dot gnu dot org
  2006-06-28  7:51 ` jvdelisle at gcc dot gnu dot org
  5 siblings, 0 replies; 11+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2006-06-28  5:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from jvdelisle at gcc dot gnu dot org  2006-06-28 05:40 -------
Subject: Bug 19904

Author: jvdelisle
Date: Wed Jun 28 05:39:07 2006
New Revision: 115049

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=115049
Log:
2006-06-27  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

        PR fortran/19310
        PR fortran/19904
        * gfortran.dg/real_const_3.f90: New test.

Added:
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/real_const_3.f90
Modified:
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/19904] [4.1 Only] Division by zero leads to error
       [not found] <bug-19904-7427@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2006-06-28  5:41 ` jvdelisle at gcc dot gnu dot org
@ 2006-06-28  7:51 ` jvdelisle at gcc dot gnu dot org
  5 siblings, 0 replies; 11+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2006-06-28  7:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from jvdelisle at gcc dot gnu dot org  2006-06-28 05:52 -------
Fixed on 4.1 branch now.


-- 

jvdelisle at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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


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

* [Bug fortran/19904] Division by zero leads to error
  2005-02-11 17:33 [Bug fortran/19904] New: " schnetter at aei dot mpg dot de
                   ` (3 preceding siblings ...)
  2005-02-11 22:48 ` sgk at troutmask dot apl dot washington dot edu
@ 2005-02-11 23:42 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-02-11 23:42 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement


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


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

* [Bug fortran/19904] Division by zero leads to error
  2005-02-11 17:33 [Bug fortran/19904] New: " schnetter at aei dot mpg dot de
                   ` (2 preceding siblings ...)
  2005-02-11 21:50 ` schnetter at aei dot mpg dot de
@ 2005-02-11 22:48 ` sgk at troutmask dot apl dot washington dot edu
  2005-02-11 23:42 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 11+ messages in thread
From: sgk at troutmask dot apl dot washington dot edu @ 2005-02-11 22:48 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From sgk at troutmask dot apl dot washington dot edu  2005-02-11 17:44 -------
You are probably right that my example does not conform to the standard,
because I don't use equilance() and I whipped up the example in a minute
without inspection of its conformance.

Anyway, if you want to make gfortran accept your code, constant folding
is done in arith.c.  I suggest that you add a -fallow_inf_nan option
to gfortran and make the appropriate modifications to arith.c

-- 


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


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

* [Bug fortran/19904] Division by zero leads to error
  2005-02-11 17:33 [Bug fortran/19904] New: " schnetter at aei dot mpg dot de
  2005-02-11 19:16 ` [Bug fortran/19904] " pinskia at gcc dot gnu dot org
  2005-02-11 21:34 ` sgk at troutmask dot apl dot washington dot edu
@ 2005-02-11 21:50 ` schnetter at aei dot mpg dot de
  2005-02-11 22:48 ` sgk at troutmask dot apl dot washington dot edu
  2005-02-11 23:42 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 11+ messages in thread
From: schnetter at aei dot mpg dot de @ 2005-02-11 21:50 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From schnetter at aei dot mpg dot de  2005-02-11 17:17 -------
Actually, gfortran handles nans correctly (according to the IEEE standard) in 
all other cases.  I can e.g. generate a nan through the expression a/b, if I 
only hide from the compiler the fact that b is zero, so that it generates code 
that performs the division at run time, and does not try to evaluate it at 
compile time. 
 
Also, while your argument is correct that the Fortran 95 standard does not 
require nans to be handled correctly, your code is also undefined according to 
the Fortran 95 standard, because you use the variable "nan" without defining 
it: if you assign to an equivalenced storage an integer value, then you are 
only allowed to read out the integer value, and vice versa for the real value. 
 

-- 


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


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

* [Bug fortran/19904] Division by zero leads to error
  2005-02-11 17:33 [Bug fortran/19904] New: " schnetter at aei dot mpg dot de
  2005-02-11 19:16 ` [Bug fortran/19904] " pinskia at gcc dot gnu dot org
@ 2005-02-11 21:34 ` sgk at troutmask dot apl dot washington dot edu
  2005-02-11 21:50 ` schnetter at aei dot mpg dot de
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: sgk at troutmask dot apl dot washington dot edu @ 2005-02-11 21:34 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From sgk at troutmask dot apl dot washington dot edu  2005-02-11 17:10 -------
Gfortran is a Fortran 95 compiler, and AFAIK gfortran's behavior conforms
to the Fortran 95 standard, because it has no allowance for floating point
exception.  Someday, gfortran may/will support Technical Report ISO/IEC
15580: 1998(E), which will then permit the use of the ieee_arithmetic,
ieee_features, and ieee_exceptions intrinsic modules.

If you want to set a NaN in gfortran you can do,

program test
   real nan
   integer duh
   equivalence (nan,duh)
   duh = z'FFC00000'
   print*, nan
end program test

The question then becomes "what are going to do with NaN?"
I suspect the gfortran's behavior of the numeric rational
operation and numeric binary operation may give undefined
behavior, which is again permitted by the Fortran 95 standard.

-- 


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


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

* [Bug fortran/19904] Division by zero leads to error
  2005-02-11 17:33 [Bug fortran/19904] New: " schnetter at aei dot mpg dot de
@ 2005-02-11 19:16 ` pinskia at gcc dot gnu dot org
  2005-02-11 21:34 ` sgk at troutmask dot apl dot washington dot edu
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-02-11 19:16 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-02-11 13:50 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |rejects-valid
   Last reconfirmed|0000-00-00 00:00:00         |2005-02-11 13:50:33
               date|                            |


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


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

end of thread, other threads:[~2006-06-28  5:52 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-19904-7427@http.gcc.gnu.org/bugzilla/>
2006-06-08  1:17 ` [Bug fortran/19904] Division by zero leads to error jvdelisle at gcc dot gnu dot org
2006-06-18  6:42 ` jvdelisle at gcc dot gnu dot org
2006-06-18  9:35 ` [Bug fortran/19904] [4.1 Only] " jvdelisle at gcc dot gnu dot org
2006-06-28  5:40 ` jvdelisle at gcc dot gnu dot org
2006-06-28  5:41 ` jvdelisle at gcc dot gnu dot org
2006-06-28  7:51 ` jvdelisle at gcc dot gnu dot org
2005-02-11 17:33 [Bug fortran/19904] New: " schnetter at aei dot mpg dot de
2005-02-11 19:16 ` [Bug fortran/19904] " pinskia at gcc dot gnu dot org
2005-02-11 21:34 ` sgk at troutmask dot apl dot washington dot edu
2005-02-11 21:50 ` schnetter at aei dot mpg dot de
2005-02-11 22:48 ` sgk at troutmask dot apl dot washington dot edu
2005-02-11 23:42 ` 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).