public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/20441] -finit-local-zero is missing from gfortran
[not found] <bug-20441-6528@http.gcc.gnu.org/bugzilla/>
@ 2006-02-07 12:48 ` fxcoudert at gcc dot gnu dot org
2006-08-20 20:51 ` tobias dot burnus at physik dot fu-berlin dot de
` (10 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2006-02-07 12:48 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from fxcoudert at gcc dot gnu dot org 2006-02-07 12:48 -------
*** Bug 26150 has been marked as a duplicate of this bug. ***
--
fxcoudert at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |fxcoudert at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20441
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/20441] -finit-local-zero is missing from gfortran
[not found] <bug-20441-6528@http.gcc.gnu.org/bugzilla/>
2006-02-07 12:48 ` [Bug fortran/20441] -finit-local-zero is missing from gfortran fxcoudert at gcc dot gnu dot org
@ 2006-08-20 20:51 ` tobias dot burnus at physik dot fu-berlin dot de
2006-08-21 1:38 ` pinskia at gcc dot gnu dot org
` (9 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: tobias dot burnus at physik dot fu-berlin dot de @ 2006-08-20 20:51 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from tobias dot burnus at physik dot fu-berlin dot de 2006-08-20 20:51 -------
Besides zero initialization (of Real, complex, integer, (what about logical?)),
a initialization to a (signaling) NaN (for complex, real) would be also nice to
find uninitialized variables.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20441
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/20441] -finit-local-zero is missing from gfortran
[not found] <bug-20441-6528@http.gcc.gnu.org/bugzilla/>
2006-02-07 12:48 ` [Bug fortran/20441] -finit-local-zero is missing from gfortran fxcoudert at gcc dot gnu dot org
2006-08-20 20:51 ` tobias dot burnus at physik dot fu-berlin dot de
@ 2006-08-21 1:38 ` pinskia at gcc dot gnu dot org
2006-11-27 16:03 ` burnus at gcc dot gnu dot org
` (8 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-08-21 1:38 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from pinskia at gcc dot gnu dot org 2006-08-21 01:38 -------
(In reply to comment #3)
> Besides zero initialization (of Real, complex, integer, (what about logical?)),
> a initialization to a (signaling) NaN (for complex, real) would be also nice to
> find uninitialized variables.
Why use -Wuninitialize will warn about those cases (though it can produce some
false positives).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20441
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/20441] -finit-local-zero is missing from gfortran
[not found] <bug-20441-6528@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2006-08-21 1:38 ` pinskia at gcc dot gnu dot org
@ 2006-11-27 16:03 ` burnus at gcc dot gnu dot org
2006-11-27 16:47 ` pinskia at gcc dot gnu dot org
` (7 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: burnus at gcc dot gnu dot org @ 2006-11-27 16:03 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from burnus at gcc dot gnu dot org 2006-11-27 16:02 -------
> > Besides zero initialization [...] a initialization to a (signaling) NaN (for
> > complex, real) would be also nice to find uninitialized variables.
>
> Why use -Wuninitialize will warn about those cases (though it can produce some
> false positives).
-Wuninitialize does not always work (false negative). Or how do you expect a
compiler to find the problem in such cases:
real :: r
call myFunc(r, .true.)
contains
subroutine myFunc(r,l)
real, intent(inout) :: r
logical :: l
if(l) then
r = r**2
else
r = 5
end if
end subroutine
--
burnus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20441
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/20441] -finit-local-zero is missing from gfortran
[not found] <bug-20441-6528@http.gcc.gnu.org/bugzilla/>
` (3 preceding siblings ...)
2006-11-27 16:03 ` burnus at gcc dot gnu dot org
@ 2006-11-27 16:47 ` pinskia at gcc dot gnu dot org
2006-11-30 22:57 ` tkoenig at gcc dot gnu dot org
` (6 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-11-27 16:47 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from pinskia at gcc dot gnu dot org 2006-11-27 16:47 -------
(In reply to comment #5)
> > > Besides zero initialization [...] a initialization to a (signaling) NaN (for
> > > complex, real) would be also nice to find uninitialized variables.
> >
> > Why use -Wuninitialize will warn about those cases (though it can produce some
> > false positives).
>
> -Wuninitialize does not always work (false negative). Or how do you expect a
> compiler to find the problem in such cases:
Well in that case r is unused so .. but if you made it used by a write(*,*) r
in the program, this becomes another PR with a C example which I cannot find
right now.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20441
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/20441] -finit-local-zero is missing from gfortran
[not found] <bug-20441-6528@http.gcc.gnu.org/bugzilla/>
` (4 preceding siblings ...)
2006-11-27 16:47 ` pinskia at gcc dot gnu dot org
@ 2006-11-30 22:57 ` tkoenig at gcc dot gnu dot org
2007-06-18 16:23 ` langton at gcc dot gnu dot org
` (5 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2006-11-30 22:57 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from tkoenig at gcc dot gnu dot org 2006-11-30 22:57 -------
*** Bug 30029 has been marked as a duplicate of this bug. ***
--
tkoenig at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |zig at fi dot infn dot it
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20441
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/20441] -finit-local-zero is missing from gfortran
[not found] <bug-20441-6528@http.gcc.gnu.org/bugzilla/>
` (5 preceding siblings ...)
2006-11-30 22:57 ` tkoenig at gcc dot gnu dot org
@ 2007-06-18 16:23 ` langton at gcc dot gnu dot org
2007-08-17 20:15 ` patchapp at dberlin dot org
` (4 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: langton at gcc dot gnu dot org @ 2007-06-18 16:23 UTC (permalink / raw)
To: gcc-bugs
--
langton at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |langton at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
Last reconfirmed|2005-12-18 01:54:45 |2007-06-18 16:23:28
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20441
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/20441] -finit-local-zero is missing from gfortran
[not found] <bug-20441-6528@http.gcc.gnu.org/bugzilla/>
` (6 preceding siblings ...)
2007-06-18 16:23 ` langton at gcc dot gnu dot org
@ 2007-08-17 20:15 ` patchapp at dberlin dot org
2007-08-20 12:29 ` arnaud02 at users dot sourceforge dot net
` (3 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: patchapp at dberlin dot org @ 2007-08-17 20:15 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from patchapp at dberlin dot org 2007-08-17 20:15 -------
Subject: Bug number PR20441
A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2007-08/msg01151.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20441
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/20441] -finit-local-zero is missing from gfortran
[not found] <bug-20441-6528@http.gcc.gnu.org/bugzilla/>
` (7 preceding siblings ...)
2007-08-17 20:15 ` patchapp at dberlin dot org
@ 2007-08-20 12:29 ` arnaud02 at users dot sourceforge dot net
2007-08-20 15:07 ` langton at gcc dot gnu dot org
` (2 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: arnaud02 at users dot sourceforge dot net @ 2007-08-20 12:29 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from arnaud02 at users dot sourceforge dot net 2007-08-20 12:28 -------
Adding -finit-real=nan (http://gcc.gnu.org/ml/fortran/2007-08/msg00408.html) is
a real bonus for gfortran.
Any chance to add "-finit-real=snan" to set "Signalling NaN" ?
A SNaN cannot be the result of any arithmetic operations, hence a good choice
for a unset pattern. The NAG compiler uses SNaN when using "-nan".
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20441
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/20441] -finit-local-zero is missing from gfortran
[not found] <bug-20441-6528@http.gcc.gnu.org/bugzilla/>
` (8 preceding siblings ...)
2007-08-20 12:29 ` arnaud02 at users dot sourceforge dot net
@ 2007-08-20 15:07 ` langton at gcc dot gnu dot org
2007-09-21 2:34 ` langton at gcc dot gnu dot org
2007-09-21 2:40 ` langton at gcc dot gnu dot org
11 siblings, 0 replies; 14+ messages in thread
From: langton at gcc dot gnu dot org @ 2007-08-20 15:07 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from langton at gcc dot gnu dot org 2007-08-20 15:07 -------
(In reply to comment #9)
> Adding -finit-real=nan (http://gcc.gnu.org/ml/fortran/2007-08/msg00408.html) is
> a real bonus for gfortran.
> Any chance to add "-finit-real=snan" to set "Signalling NaN" ?
> A SNaN cannot be the result of any arithmetic operations, hence a good choice
> for a unset pattern. The NAG compiler uses SNaN when using "-nan".
I'd like to add finit-real=snan. Right now, this requires a bit of a hack,
since mpfr (which we use internally for real constants) doesn't distinguish
between signaling and quiet NaNs:
http://gcc.gnu.org/ml/fortran/2007-07/msg00512.html
http://websympa.loria.fr/wwsympa/arc/mpfr/2007-07/msg00118.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20441
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/20441] -finit-local-zero is missing from gfortran
[not found] <bug-20441-6528@http.gcc.gnu.org/bugzilla/>
` (9 preceding siblings ...)
2007-08-20 15:07 ` langton at gcc dot gnu dot org
@ 2007-09-21 2:34 ` langton at gcc dot gnu dot org
2007-09-21 2:40 ` langton at gcc dot gnu dot org
11 siblings, 0 replies; 14+ messages in thread
From: langton at gcc dot gnu dot org @ 2007-09-21 2:34 UTC (permalink / raw)
To: gcc-bugs
------- Comment #11 from langton at gcc dot gnu dot org 2007-09-21 02:34 -------
Subject: Bug 20441
Author: langton
Date: Fri Sep 21 02:34:14 2007
New Revision: 128643
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=128643
Log:
PR fortran/20441
* gfortran.h : Add init_local_* enums and init_flag_* flags to
gfc_option_t.
* lang.opt: Add -finit-local-zero, -finit-real, -finit-integer,
-finit-character, and -finit-logical flags.
* invoke.texi: Document new options.
* resolve.c (build_init_assign): New function.
(apply_init_assign): Move part of function into build_init_assign.
(build_default_init_expr): Build local initializer (-finit-*).
(apply_default_init_local): Apply local initializer (-finit-*).
(resolve_fl_variable): Try to add local initializer (-finit-*).
* options.c (gfc_init_options, gfc_handle_option,
gfc_post_options): Handle -finit-local-zero, -finit-real,
-finit-integer, -finit-character, and -finit-logical flags.
PR fortran/20441
* gfortran.dg/init_flag_1.f90: New.
* gfortran.dg/init_flag_2.f90: New.
* gfortran.dg/init_flag_3.f90: New.
* gfortran.dg/init_flag_4.f90: New.
* gfortran.dg/init_flag_5.f90: New.
* gfortran.dg/init_flag_6.f90: New.
* gfortran.dg/init_flag_7.f90: New.
Added:
trunk/gcc/testsuite/gfortran.dg/init_flag_1.f90
trunk/gcc/testsuite/gfortran.dg/init_flag_2.f90
trunk/gcc/testsuite/gfortran.dg/init_flag_3.f90
trunk/gcc/testsuite/gfortran.dg/init_flag_4.f90
trunk/gcc/testsuite/gfortran.dg/init_flag_5.f90
trunk/gcc/testsuite/gfortran.dg/init_flag_6.f90
trunk/gcc/testsuite/gfortran.dg/init_flag_7.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/gfortran.h
trunk/gcc/fortran/invoke.texi
trunk/gcc/fortran/lang.opt
trunk/gcc/fortran/options.c
trunk/gcc/fortran/resolve.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20441
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/20441] -finit-local-zero is missing from gfortran
[not found] <bug-20441-6528@http.gcc.gnu.org/bugzilla/>
` (10 preceding siblings ...)
2007-09-21 2:34 ` langton at gcc dot gnu dot org
@ 2007-09-21 2:40 ` langton at gcc dot gnu dot org
11 siblings, 0 replies; 14+ messages in thread
From: langton at gcc dot gnu dot org @ 2007-09-21 2:40 UTC (permalink / raw)
To: gcc-bugs
------- Comment #12 from langton at gcc dot gnu dot org 2007-09-21 02:40 -------
Fixed on trunk as of revision 128643.
--
langton at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20441
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/20441] -finit-local-zero is missing from gfortran
2005-03-12 17:11 [Bug fortran/20441] New: " pinskia at gcc dot gnu dot org
2005-03-12 22:54 ` [Bug fortran/20441] " tobi at gcc dot gnu dot org
@ 2005-03-14 18:05 ` dir at lanl dot gov
1 sibling, 0 replies; 14+ messages in thread
From: dir at lanl dot gov @ 2005-03-14 18:05 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From dir at lanl dot gov 2005-03-14 18:05 -------
This option is needed with most codes decended from main frame codes because
almost all compiliers for the main frames did something like "-finit-local-zero"
by default. The widely used suite of finite element codes from Livermore -
DYNA3D, DYNA2D, NIKE2D, NIKE3D, TOPAZ2D, TOPAZ3D, MAZE, INGRID, ORIAN and TAURUS
all require this option. Going through hundreds of thousands of lines of codes
and trying to patch it to work with out "-finit-local-zero" is hopeless.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20441
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/20441] -finit-local-zero is missing from gfortran
2005-03-12 17:11 [Bug fortran/20441] New: " pinskia at gcc dot gnu dot org
@ 2005-03-12 22:54 ` tobi at gcc dot gnu dot org
2005-03-14 18:05 ` dir at lanl dot gov
1 sibling, 0 replies; 14+ messages in thread
From: tobi at gcc dot gnu dot org @ 2005-03-12 22:54 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2005-03-12 22:54:35
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20441
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2007-09-21 2:40 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-20441-6528@http.gcc.gnu.org/bugzilla/>
2006-02-07 12:48 ` [Bug fortran/20441] -finit-local-zero is missing from gfortran fxcoudert at gcc dot gnu dot org
2006-08-20 20:51 ` tobias dot burnus at physik dot fu-berlin dot de
2006-08-21 1:38 ` pinskia at gcc dot gnu dot org
2006-11-27 16:03 ` burnus at gcc dot gnu dot org
2006-11-27 16:47 ` pinskia at gcc dot gnu dot org
2006-11-30 22:57 ` tkoenig at gcc dot gnu dot org
2007-06-18 16:23 ` langton at gcc dot gnu dot org
2007-08-17 20:15 ` patchapp at dberlin dot org
2007-08-20 12:29 ` arnaud02 at users dot sourceforge dot net
2007-08-20 15:07 ` langton at gcc dot gnu dot org
2007-09-21 2:34 ` langton at gcc dot gnu dot org
2007-09-21 2:40 ` langton at gcc dot gnu dot org
2005-03-12 17:11 [Bug fortran/20441] New: " pinskia at gcc dot gnu dot org
2005-03-12 22:54 ` [Bug fortran/20441] " tobi at gcc dot gnu dot org
2005-03-14 18:05 ` dir at lanl dot gov
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).