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/23905] misbehavior of function "gfc_copy_array_spec" in gcc/fortran/array.c


------- Additional Comments From fxcoudert at gcc dot gnu dot org  2005-09-24 14:15 -------
I believe the gfc_copy_array_spec() function is correct. Its purpose is to
allocate memory for the dest gfc_array_spec. It then copies all fields of src
into dest (Steve: copying pointers would be "dest = src", but "*dest = *src"
really copies the contents of the gfc_array_spec).

After that, the loop is used to create copies of lower and upper fields. Since
these fields were copied from src into dest in the last step ("*dest = *src"),

dest->lower[i] = gfc_copy_expr (dest->lower[i]);

is really equivalent to

dest->lower[i] = gfc_copy_expr (src->lower[i]);


Closing this PR accordingly. If I missed something, please feel free to reopen.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fxcoudert at gcc dot gnu dot
                   |                            |org, kargl at gcc dot gnu
                   |                            |dot org
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED


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


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