]> git.ipfire.org Git - thirdparty/gcc.git/commit
PR fortran/83344 Don't set bogus constant value
authorjb <jb@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 28 Dec 2017 18:49:12 +0000 (18:49 +0000)
committerjb <jb@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 28 Dec 2017 18:49:12 +0000 (18:49 +0000)
commit02c1ba60eefb72a0c36a6389af69875f2e4216af
tree580b1b983ec82b840b86649b556573849f117aa4
parente497ad7306f4a069325448db1dba58d5ba316886
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  <jb@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  <jb@gcc.gnu.org>

PR fortran/83344
* gfortran.dg/associate_22.f90: Comment out part of test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@256021 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/fortran/ChangeLog
gcc/fortran/resolve.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/associate_22.f90