https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83344
--- Comment #10 from Janne Blomqvist <jb at gcc dot gnu.org> --- Author: jb Date: Thu Dec 28 18:49:12 2017 New Revision: 256021 URL: https://gcc.gnu.org/viewcvs?rev=256021&root=gcc&view=rev Log: PR fortran/83344 Don't set bogus constant value This patch does not fix PR 83344, but merely fixes an error where we used to set a constant character length value from a non-constant expression, and thus set it to some bogus value. As a result of this, I have commented out part of the associate_22.f90 test which otherwise generates a warning message. Regtested on x86_64-pc-linux-gnu. gcc/fortran/ChangeLog: 2017-12-28 Janne Blomqvist <j...@gcc.gnu.org> PR fortran/83344 * resolve.c (resolve_assoc_var): Don't set the constant value unless the target is a constant expression. gcc/testsuite/ChangeLog: 2017-12-28 Janne Blomqvist <j...@gcc.gnu.org> PR fortran/83344 * gfortran.dg/associate_22.f90: Comment out part of test. Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/resolve.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gfortran.dg/associate_22.f90