[Bug fortran/89200] [9 Regression] Erroneous copying of a derived type with a deferred-length character array component

2019-02-09 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89200

Paul Thomas  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #6 from Paul Thomas  ---
Thanks for the report.

Paul

[Bug fortran/89200] [9 Regression] Erroneous copying of a derived type with a deferred-length character array component

2019-02-09 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89200

--- Comment #5 from Paul Thomas  ---
Author: pault
Date: Sat Feb  9 11:11:33 2019
New Revision: 268721

URL: https://gcc.gnu.org/viewcvs?rev=268721=gcc=rev
Log:
2019-02-09  Paul Thomas  

PR fortran/89200
* trans-array.c (gfc_trans_create_temp_array): Set the 'span'
field for derived types.

2019-02-09  Paul Thomas  

PR fortran/89200
* gfortran.dg/array_reference_2.f90 : New test.


Added:
trunk/gcc/testsuite/gfortran.dg/array_reference_2.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/trans-array.c
trunk/gcc/testsuite/ChangeLog

[Bug fortran/89200] [9 Regression] Erroneous copying of a derived type with a deferred-length character array component

2019-02-05 Thread damian at sourceryinstitute dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89200

--- Comment #4 from Damian Rouson  ---
Thanks, Paul!

[Bug fortran/89200] [9 Regression] Erroneous copying of a derived type with a deferred-length character array component

2019-02-05 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89200

Paul Thomas  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |pault at gcc dot gnu.org

--- Comment #3 from Paul Thomas  ---
Created attachment 45602
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45602=edit
Fix for the bug

Since it is my doing, I had better fix the problem!

The copying was OK but the array element addressing was not, since the 'span'
field in the descriptor was never set.

The attached does the job but the test leaks memory, as it has in all versions
going way back when.

I'll commit as 'obvious' tonight.

Paul

[Bug fortran/89200] [9 Regression] Erroneous copying of a derived type with a deferred-length character array component

2019-02-04 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89200

Dominique d'Humieres  changed:

   What|Removed |Added

   Priority|P3  |P4
 Status|UNCONFIRMED |NEW
  Known to work||8.2.0
   Keywords||wrong-code
   Last reconfirmed||2019-02-04
 CC||pault at gcc dot gnu.org
 Blocks||68241
 Ever confirmed|0   |1
   Target Milestone|--- |9.0
  Known to fail||9.0

--- Comment #2 from Dominique d'Humieres  ---
Confirmed between revisions r264722 (2018-09-30, 12) and r264810 (2018-10-03,
11), may be r264724 (PRs 70752, 72709).


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68241
[Bug 68241] [meta-bug] [F03] Deferred-length character

[Bug fortran/89200] [9 Regression] Erroneous copying of a derived type with a deferred-length character array component

2019-02-04 Thread damian at sourceryinstitute dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89200

--- Comment #1 from Damian Rouson  ---
gfortran 8.2.0 code gives the correct output:

$gfortran corrupted-component.f90 

$./a.out
 12

$gfortran --version
GNU Fortran (GCC) 8.2.0