[Bug fortran/84495] Incorrect result for concatenation of Fortran allocatable string

2018-02-22 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84495

Thomas Koenig  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #6 from Thomas Koenig  ---
Backported the patch due to overwhelming popular demand :-)

This really is a duplicate, closing the patch as such.

*** This bug has been marked as a duplicate of bug 81116 ***

[Bug fortran/84495] Incorrect result for concatenation of Fortran allocatable string

2018-02-22 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84495

--- Comment #5 from Thomas Koenig  ---
Author: tkoenig
Date: Thu Feb 22 18:52:21 2018
New Revision: 257912

URL: https://gcc.gnu.org/viewcvs?rev=257912=gcc=rev
Log:
2018-02-22  Thomas Koenig  

PR fortran/81116
PR fortran/84495
Backport from trunk
* frontend-passes.c (realloc_string_callback): If expression is a
concatenation, also check for dependency.
(constant_string_length): Check for presence of symtree.

2018-02-22  Thomas Koenig  

PR fortran/81116
PR fortran/84495
* gfortran.dg/realloc_on_assignment_29.f90:  New test.


Added:
branches/gcc-7-branch/gcc/testsuite/gfortran.dg/realloc_on_assign_29.f90
Modified:
branches/gcc-7-branch/gcc/fortran/ChangeLog
branches/gcc-7-branch/gcc/fortran/frontend-passes.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug fortran/84495] Incorrect result for concatenation of Fortran allocatable string

2018-02-21 Thread sgk at troutmask dot apl.washington.edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84495

--- Comment #4 from Steve Kargl  ---
On Wed, Feb 21, 2018 at 10:44:07AM +, tkoenig at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84495
> 
> Thomas Koenig  changed:
> 
>What|Removed |Added
> 
>  CC||tkoenig at gcc dot gnu.org
> 
> --- Comment #2 from Thomas Koenig  ---
> This looks like a duplicate of PR81116, fixed by r251125.
> 
> This is not a regression, and in genereal (we have played loose with
> this rule) we are not supposed to backport.
> 
> Opinions?
> 

Release Manager would probably say that it is up the Fortran
Maintainers on whether something should be backported.  If I
have a patch on trunk that applies to the branch(es) with
minimum effort, I tend to backport to keep code in sync.

[Bug fortran/84495] Incorrect result for concatenation of Fortran allocatable string

2018-02-21 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84495

Dominique d'Humieres  changed:

   What|Removed |Added

   Keywords||wrong-code

--- Comment #3 from Dominique d'Humieres  ---
> This looks like a duplicate of PR81116, fixed by r251125.
>
> This is not a regression, and in genereal (we have played loose with
> this rule) we are not supposed to backport.
>
> Opinions?

This is silent wrong code. IMO this should be back ported.

[Bug fortran/84495] Incorrect result for concatenation of Fortran allocatable string

2018-02-21 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84495

Thomas Koenig  changed:

   What|Removed |Added

 CC||tkoenig at gcc dot gnu.org

--- Comment #2 from Thomas Koenig  ---
This looks like a duplicate of PR81116, fixed by r251125.

This is not a regression, and in genereal (we have played loose with
this rule) we are not supposed to backport.

Opinions?

[Bug fortran/84495] Incorrect result for concatenation of Fortran allocatable string

2018-02-20 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84495

kargl at gcc dot gnu.org changed:

   What|Removed |Added

   Priority|P3  |P4
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-02-20
 CC||kargl at gcc dot gnu.org
  Known to work||8.0
 Ever confirmed|0   |1
  Known to fail||6.4.1, 7.3.1

--- Comment #1 from kargl at gcc dot gnu.org ---
David,

This appears to be fixed on trunk, and broken on the
6 and 7 branches.  I don't have older versions lying
around to test.

 gfcx -o z a.f90 && ./z
 123456789
 123A6789
troutmask:sgk[205] gfc7 -o z a.f90 && ./z
 123456789
 123A678 
troutmask:sgk[206] gfc6 -o z a.f90 && ./z
 123456789
 123A678 

I'm not sure if a back port of the patch (if one can even
be identified) can be applied to branches due to changes
in how strings are handled.

I'll mark this as NEW and hopefully others can chime in.