PR 50892 Latent bug in char pointer assignment
commitee2d3987461ecc6ab82d484aeed066597c146587
authorJanne Blomqvist <jb@gcc.gnu.org>
Sat, 6 Jan 2018 10:41:03 +0000 (6 12:41 +0200)
committerJanne Blomqvist <jb@gcc.gnu.org>
Sat, 6 Jan 2018 10:41:03 +0000 (6 12:41 +0200)
tree4adcbcaed104f34073bffd30cd0f4d866bd98de2
parent59931fb066cc0526c103dfd5a97c6d0f2797e554
PR 50892 Latent bug in char pointer assignment

Due to r256284 (PR 78534) there was a latent bug that reared it's head
due to different character length types in the pointer
assignment. Fixed by this patch, which also adds a reduced testcase.

Regtested on x86_64-pc-linux-gnu, committed to trunk as obvious.

gcc/fortran/ChangeLog:

2018-01-06  Janne Blomqvist  <jb@gcc.gnu.org>

PR fortran/50892
* trans-expr.c (gfc_trans_pointer_assignment): fold_convert rhs to
lhs type.

gcc/testsuite/ChangeLog:

2018-01-06  Janne Blomqvist  <jb@gcc.gnu.org>

PR fortran/50892
* gfortran.dg/char_pointer_assign_icb_1.f90: New test.

From-SVN: r256310
gcc/fortran/ChangeLog
gcc/fortran/trans-expr.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/char_pointer_assign_icb_1.f90 [new file with mode: 0644]