This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/23905] misbehavior of function "gfc_copy_array_spec" in gcc/fortran/array.c
- From: "fxcoudert at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Sep 2005 14:15:30 -0000
- Subject: [Bug fortran/23905] misbehavior of function "gfc_copy_array_spec" in gcc/fortran/array.c
- References: <20050915223526.23905.skyhover@hotmail.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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