This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [Patch, Fortran] PRs 61881/61888 - Fix issues with SIZEOF, CLASS(*) and assumed-rank
- From: Tobias Burnus <burnus at net-b dot de>
- To: Paul Richard Thomas <paul dot richard dot thomas at gmail dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, gfortran <fortran at gcc dot gnu dot org>
- Date: Sat, 26 Jul 2014 19:59:18 +0200
- Subject: Re: [Patch, Fortran] PRs 61881/61888 - Fix issues with SIZEOF, CLASS(*) and assumed-rank
- Authentication-results: sourceware.org; auth=none
- References: <53D2EC76 dot 3000907 at net-b dot de> <CAGkQGiJEUXMT-Dxrt3mbrmu5PCcUViYGM=adGn_wf7+s0z07oQ at mail dot gmail dot com> <53D37A73 dot 5080603 at net-b dot de>
Tobias Burnus wrote:
Assuming that the second part is okay, I have now committed it with
the comment-style change as Rev. 213079.
Dominique has pointed out (thanks!) that the patch fixed PR57305 - and
reading that PR, I saw that I missed the declared -> dynamic type
change. Hence, I have committed the attached patch (as Rev. 213085) and
added also the PR numbers to the changelog, what I had missed before.
Tobias
Index: gcc/fortran/ChangeLog
===================================================================
--- gcc/fortran/ChangeLog (Revision 213084)
+++ gcc/fortran/ChangeLog (Arbeitskopie)
@@ -1,5 +1,16 @@
2014-07-26 Tobias Burnus <burnus@net-b.de>
+ PR fortran/61881
+ PR fortran/61888
+ PR fortran/57305
+ * intrinsic.texi (SIZEOF): Document changed behavior
+ for polymorphic arrays.
+
+2014-07-26 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/61881
+ PR fortran/61888
+ PR fortran/57305
* check.c (gfc_check_sizeof): Permit for assumed type if and
only if it has an array descriptor.
* intrinsic.c (do_ts29113_check): Permit SIZEOF.
Index: gcc/fortran/intrinsic.texi
===================================================================
--- gcc/fortran/intrinsic.texi (Revision 213084)
+++ gcc/fortran/intrinsic.texi (Arbeitskopie)
@@ -12204,10 +12204,10 @@ number of bytes occupied by the argument. If the
to is returned. If the argument is of a derived type with @code{POINTER}
or @code{ALLOCATABLE} components, the return value does not account for
the sizes of the data pointed to by these components. If the argument is
-polymorphic, the size according to the declared type is returned. The argument
+polymorphic, the size according to the dynamic type is returned. The argument
may not be a procedure or procedure pointer. Note that the code assumes for
arrays that those are contiguous; for contiguous arrays, it returns the
-storage or an array element multiplicated by the size of the array.
+storage or an array element multiplied by the size of the array.
@item @emph{Example}:
@smallexample
Index: gcc/testsuite/ChangeLog
===================================================================
--- gcc/testsuite/ChangeLog (Revision 213084)
+++ gcc/testsuite/ChangeLog (Arbeitskopie)
@@ -5,6 +5,9 @@
2014-07-26 Tobias Burnus <burnus@net-b.de>
+ PR fortran/61881
+ PR fortran/61888
+ PR fortran/57305
* gfortran.dg/sizeof_2.f90: Change dg-error.
* gfortran.dg/sizeof_4.f90: New.
* gfortran.dg/storage_size_1.f08: Correct expected