[Bug fortran/87045] pointer to array of character

2019-03-13 Thread anlauf at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87045

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

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

--- Comment #5 from anlauf at gcc dot gnu.org ---
Fixed on trunk.

[Bug fortran/87045] pointer to array of character

2019-03-13 Thread anlauf at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87045

--- Comment #4 from anlauf at gcc dot gnu.org ---
Author: anlauf
Date: Wed Mar 13 21:33:27 2019
New Revision: 269664

URL: https://gcc.gnu.org/viewcvs?rev=269664=gcc=rev
Log:
2019-03-13  Harald Anlauf  

PR fortran/87045
* trans-expr.c (gfc_trans_pointer_assignment): Move check for same
string length so that we do not get false errors for deferred
length.

PR fortran/87045
* gfortran.dg/pr87045.f90: New test.


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

[Bug fortran/87045] pointer to array of character

2019-03-10 Thread anlauf at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87045

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

 CC||anlauf at gcc dot gnu.org

--- Comment #3 from anlauf at gcc dot gnu.org ---
Patch that moves the check submitted:

https://gcc.gnu.org/ml/fortran/2019-03/msg00050.html

[Bug fortran/87045] pointer to array of character

2019-03-08 Thread anlauf at gmx dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87045

--- Comment #2 from Harald Anlauf  ---
With trunk it appears essential to have at least -fcheck=bounds
as option, otherwise the testcase passes for me.

The dump-tree for the critical code part (with -fcheck=bounds):

p = t;
p.span = (integer(kind=8)) SAVE_EXPR ;
if ((integer(kind=8)) (.p != .t))
  {
_gfortran_runtime_error_at (&"At line 8 of file pr87045.f90"[1]{lb: 1
sz: 1}, &"Unequal character lengths (%ld/%ld) in %s"[1]{lb: 1 sz: 1}, .p, .t,
&"pointer assignment"[1]{lb: 1 sz: 1});
  }
.p = .t;

Has the check been put into the wrong place?

[Bug fortran/87045] pointer to array of character

2018-08-25 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87045

Thomas Koenig  changed:

   What|Removed |Added

   Keywords||wrong-code
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-08-25
 CC||tkoenig at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Thomas Koenig  ---
Confirmed; valgrind shows uninitialized variables.

That seems to go back to 4.8 at least, so it does not look
like a regression.