public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/57904] New: Bogus(?) "invokes undefined behavior" warning with Fortran's finalization wrapper (gfortran.dg/class_48.f90)
@ 2013-07-16  9:05 burnus at gcc dot gnu.org
  2013-07-23 19:53 ` [Bug fortran/57904] " jamborm at gcc dot gnu.org
                   ` (19 more replies)
  0 siblings, 20 replies; 21+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-07-16  9:05 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 57904
           Summary: Bogus(?) "invokes undefined behavior" warning with
                    Fortran's finalization wrapper
                    (gfortran.dg/class_48.f90)
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org

The test case is based on gfortran.dg/class_48.f90 - and the issue is exposed
by r200954.

Compiling the following test case with "gfortran -m32 -O2"  (or "-m32 -Os")
gives the warning:

test.f90: In function '__final_test2_T.1838.constprop.0':
test.f90:21:0: warning: iteration 2147483648 invokes undefined behavior
[-Waggressive-loop-optimizations]
       class(t), allocatable :: a
 ^


Test case:

program test
  call test2 ()
contains
  subroutine test2 ()
    type t
      integer, allocatable :: x
    end type t

    type t2
      class(t), allocatable :: a
    end type t2

    type(t2) :: one, two

    allocate (two%a)
    one = two
  end subroutine test2
end program test


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

end of thread, other threads:[~2014-01-17 17:51 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-16  9:05 [Bug fortran/57904] New: Bogus(?) "invokes undefined behavior" warning with Fortran's finalization wrapper (gfortran.dg/class_48.f90) burnus at gcc dot gnu.org
2013-07-23 19:53 ` [Bug fortran/57904] " jamborm at gcc dot gnu.org
2013-08-09 12:53 ` ro at gcc dot gnu.org
2013-08-19 23:03 ` [Bug fortran/57904] [4.9 Regression] " hp at gcc dot gnu.org
2013-08-20 17:40 ` bernd.edlinger at hotmail dot de
2013-10-30 13:13 ` [Bug middle-end/57904] " rguenth at gcc dot gnu.org
2013-11-27 15:55 ` jakub at gcc dot gnu.org
2013-11-27 15:59 ` Joost.VandeVondele at mat dot ethz.ch
2013-12-19 21:32 ` law at redhat dot com
2013-12-20  5:51 ` bernd.edlinger at hotmail dot de
2013-12-20  6:26 ` law at redhat dot com
2013-12-20  7:21 ` dominiq at lps dot ens.fr
2013-12-20  8:36 ` jakub at gcc dot gnu.org
2013-12-20  9:54 ` bernd.edlinger at hotmail dot de
2013-12-20 19:22 ` law at redhat dot com
2013-12-20 21:56 ` dominiq at lps dot ens.fr
2013-12-20 21:58 ` dominiq at lps dot ens.fr
2013-12-20 22:27 ` law at redhat dot com
2013-12-20 22:28 ` law at redhat dot com
2014-01-17 17:50 ` law at gcc dot gnu.org
2014-01-17 17:51 ` law at redhat dot com

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