public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/53326] New: -finit-integer, -finit-real and INTENT(OUT)
@ 2012-05-11 17:20 arnaud02 at users dot sourceforge.net
  2012-05-11 17:59 ` [Bug fortran/53326] " arnaud02 at users dot sourceforge.net
  2015-10-08  8:55 ` dominiq at lps dot ens.fr
  0 siblings, 2 replies; 3+ messages in thread
From: arnaud02 at users dot sourceforge.net @ 2012-05-11 17:20 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53326
           Summary: -finit-integer, -finit-real and INTENT(OUT)
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: arnaud02@users.sourceforge.net


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

* [Bug fortran/53326] -finit-integer, -finit-real and INTENT(OUT)
  2012-05-11 17:20 [Bug fortran/53326] New: -finit-integer, -finit-real and INTENT(OUT) arnaud02 at users dot sourceforge.net
@ 2012-05-11 17:59 ` arnaud02 at users dot sourceforge.net
  2015-10-08  8:55 ` dominiq at lps dot ens.fr
  1 sibling, 0 replies; 3+ messages in thread
From: arnaud02 at users dot sourceforge.net @ 2012-05-11 17:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Arnaud Desitter <arnaud02 at users dot sourceforge.net> 2012-05-11 17:31:12 UTC ---
Consider:
>cat UIN15-int.f
!! check whether uninitialised variables are detected
!! for INTENT(OUT) arrays
      program uin
      integer x(10)
      x = 2
      call sub2(x,size(x))      ! x undefined on return
      write(*,*) x(1)
      end
      subroutine sub2(x,n)
      integer, intent(in) :: n
      integer, intent(out) ::  x(n)
      end
>gfortran470 -finit-integer=10 UIN15-int.f
abg-ecldev01:/tmp/arnaud>./a.out
           2

>cat UIN15-double.f
!! check whether uninitialised variables are detected
!! for INTENT(OUT) arrays
      program uin
      double precision x(10)
      x = 2
      call sub2(x,size(x))      ! x undefined on return
      write(*,*) x(1)
      end
      subroutine sub2(x,n)
      integer, intent(in) :: n
      double precision, intent(out) ::  x(n)
      end
>gfortran470 -finit-real=snan UIN15-double.f
>./a.out
   2.0000000000000000

As seen above, -finit-real and -finit-integer have no effect on INTENT(OUT)
variables. This would be a nice and useful improvement.
Note that the NAG compiler ("-nan") and the Sun compiler ("-xcheck=init_local
-stackvar") implement this feature.

(tests "UNI15" of http://ftp.aset.psu.edu/pub/ger/fortran/test/results.txt are
related)


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

* [Bug fortran/53326] -finit-integer, -finit-real and INTENT(OUT)
  2012-05-11 17:20 [Bug fortran/53326] New: -finit-integer, -finit-real and INTENT(OUT) arnaud02 at users dot sourceforge.net
  2012-05-11 17:59 ` [Bug fortran/53326] " arnaud02 at users dot sourceforge.net
@ 2015-10-08  8:55 ` dominiq at lps dot ens.fr
  1 sibling, 0 replies; 3+ messages in thread
From: dominiq at lps dot ens.fr @ 2015-10-08  8:55 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53326

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-10-08
     Ever confirmed|0                           |1

--- Comment #2 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Still present on trunk (6.0) at r228594.


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

end of thread, other threads:[~2015-10-08  8:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-11 17:20 [Bug fortran/53326] New: -finit-integer, -finit-real and INTENT(OUT) arnaud02 at users dot sourceforge.net
2012-05-11 17:59 ` [Bug fortran/53326] " arnaud02 at users dot sourceforge.net
2015-10-08  8:55 ` dominiq at lps dot ens.fr

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).