This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/31620] [regression 4.3] Zeroing one component of array of derived types zeros the whole structure.
- From: "dfranke at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Apr 2007 13:25:27 -0000
- Subject: [Bug fortran/31620] [regression 4.3] Zeroing one component of array of derived types zeros the whole structure.
- References: <bug-31620-12721@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from dfranke at gcc dot gnu dot org 2007-04-18 14:25 -------
$> cat pr31620.f90
program test_assign
type my_type
integer :: a
integer :: b
end type my_type
type(my_type), dimension(1) :: mine ! note that MINE is an array
mine%b=4
mine%a=1
print *, mine
mine%a=0
print *, mine
end program test_assign
$> gfortran-svn -g -fdump-tree-original pr31620.f90
The dump shows between the print statements:
[...]
(void) __builtin_memset ((void *) &mine, 0, 8);
[...]
which obviously is the culprit.
Adding Roger Sayle as CC as he worked on this a while ago.
--
dfranke at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |roger at eyesopen dot com
Keywords| |wrong-code
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31620