This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/31620] [regression 4.3] Zeroing one component of array of derived types zeros the whole structure.



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]