This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/57904] New: Bogus(?) "invokes undefined behavior" warning with Fortran's finalization wrapper (gfortran.dg/class_48.f90)
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 16 Jul 2013 09:03:46 +0000
- Subject: [Bug fortran/57904] New: Bogus(?) "invokes undefined behavior" warning with Fortran's finalization wrapper (gfortran.dg/class_48.f90)
- Auto-submitted: auto-generated
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