[gcc-7] 205/354: * Update to SVN 20170524 (r248432) from the gcc-7-branch.

Ximin Luo infinity0 at debian.org
Thu Nov 23 15:50:54 UTC 2017


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository gcc-7.

commit 68920eefa83900c3984d79db8bf79cdb1fe76efe
Author: doko <doko at 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca>
Date:   Wed May 24 22:30:03 2017 +0000

      * Update to SVN 20170524 (r248432) from the gcc-7-branch.
    
    
    git-svn-id: svn+ssh://svn.debian.org/svn/gcccvs/branches/sid/gcc-7@9506 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca
---
 debian/changelog                |   3 +-
 debian/patches/svn-updates.diff | 476 ++++++++++++++++++++++++++++++++++++++--
 2 files changed, 460 insertions(+), 19 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 1c6c7f6..15f94b9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,9 +1,10 @@
 gcc-7 (7.1.0-7) UNRELEASED; urgency=medium
 
+  * Update to SVN 20170524 (r248432) from the gcc-7-branch.
   * Don't build libada with -O3 (ftbfs on ppc64el).
   * Restore building gnattools sequentially. Reopens #857831.
 
- -- Matthias Klose <doko at debian.org>  Wed, 24 May 2017 13:45:03 -0700
+ -- Matthias Klose <doko at debian.org>  Wed, 24 May 2017 15:29:32 -0700
 
 gcc-7 (7.1.0-6) experimental; urgency=medium
 
diff --git a/debian/patches/svn-updates.diff b/debian/patches/svn-updates.diff
index 689ab28..302bf72 100644
--- a/debian/patches/svn-updates.diff
+++ b/debian/patches/svn-updates.diff
@@ -1,10 +1,10 @@
-# DP: updates from the 7 branch upto 20170522 (r248347).
+# DP: updates from the 7 branch upto 20170524 (r248432).
 
 last_update()
 {
 	cat > ${dir}LAST_UPDATED <EOF
-Mon May 22 12:30:02 PDT 2017
-Mon May 22 19:30:02 UTC 2017 (revision 248347)
+Wed May 24 15:20:51 PDT 2017
+Wed May 24 22:20:51 UTC 2017 (revision 248432)
 EOF
 }
 
@@ -559,7 +559,11 @@ Index: maintainer-scripts/ChangeLog
 ===================================================================
 --- a/src/maintainer-scripts/ChangeLog	(.../tags/gcc_7_1_0_release)
 +++ b/src/maintainer-scripts/ChangeLog	(.../branches/gcc-7-branch)
-@@ -1,3 +1,14 @@
+@@ -1,3 +1,18 @@
++2017-05-23  Matthias Klose  <doko at ubuntu.com>
++
++	* gcc_release (XZ): Default to xz --best.
++
 +2017-05-18  Matthias Klose  <doko at ubuntu.com>
 +
 +	* gcc_release (build_gzip): Build xz tarball instead of bz2 tarball.
@@ -574,7 +578,7 @@ Index: maintainer-scripts/ChangeLog
  2017-05-02  Release Manager
  
  	* GCC 7.1.0 released.
-@@ -19,7 +30,7 @@
+@@ -19,7 +34,7 @@
  
  2016-09-04  Gerald Pfeifer  <gerald at pfeifer.com>
  
@@ -707,7 +711,7 @@ Index: maintainer-scripts/gcc_release
  # Programs we use.
  
  BZIP2="${BZIP2:-bzip2}"
-+XZ="${XZ:-xz}"
++XZ="${XZ:-xz --best}"
  CVS="${CVS:-cvs -f -Q -z9}"
  DIFF="${DIFF:-diff -Nrcpad}"
  ENV="${ENV:-env}"
@@ -879,7 +883,7 @@ Index: gcc/DATESTAMP
 +++ b/src/gcc/DATESTAMP	(.../branches/gcc-7-branch)
 @@ -1 +1 @@
 -20170502
-+20170522
++20170524
 Index: gcc/tree-chrec.c
 ===================================================================
 --- a/src/gcc/tree-chrec.c	(.../tags/gcc_7_1_0_release)
@@ -1008,7 +1012,20 @@ Index: gcc/ChangeLog
 ===================================================================
 --- a/src/gcc/ChangeLog	(.../tags/gcc_7_1_0_release)
 +++ b/src/gcc/ChangeLog	(.../branches/gcc-7-branch)
-@@ -1,3 +1,146 @@
+@@ -1,3 +1,159 @@
++2017-05-23  Sheldon Lobo  <sheldon.lobo at oracle.com>
++
++	Backport from mainline
++	2017-05-18  Sheldon Lobo  <sheldon.lobo at oracle.com>
++
++	* config/sparc/sparc.c (sparc_option_override): Set function
++	alignment for -mcpu=niagara7 to 64 to match the I$ line.
++	* config/sparc/sparc.h (BRANCH_COST): Set the SPARC M7 branch
++	latency to 1.
++	* config/sparc/sparc.h (BRANCH_COST): Set the SPARC T4 branch
++	latency to 2.
++	* config/sparc/sol2.h: Fix a ASM_CPU32_DEFAULT_SPEC typo.
++
 +2017-05-19  Uros Bizjak  <ubizjak at gmail.com>
 +
 +	Backport from mainline
@@ -1160,7 +1177,7 @@ Index: gcc/testsuite/gcc.target/powerpc/p8-vec-xl-xst.c
 --- a/src/gcc/testsuite/gcc.target/powerpc/p8-vec-xl-xst.c	(.../tags/gcc_7_1_0_release)
 +++ b/src/gcc/testsuite/gcc.target/powerpc/p8-vec-xl-xst.c	(.../branches/gcc-7-branch)
 @@ -0,0 +1,62 @@
-+/* { dg-do compile { target { powerpc*-*-* } } } */
++/* { dg-do compile { target { powerpc64le-*-* } } } */
 +/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
 +/* { dg-require-effective-target powerpc_p8vector_ok } */
 +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
@@ -1344,6 +1361,15 @@ Index: gcc/testsuite/gcc.target/powerpc/ppc-round3.c
 +{
 +  return (float)(unsigned int)a;
 +}
+Index: gcc/testsuite/gcc.target/sparc/niagara7-align.c
+===================================================================
+--- a/src/gcc/testsuite/gcc.target/sparc/niagara7-align.c	(.../tags/gcc_7_1_0_release)
++++ b/src/gcc/testsuite/gcc.target/sparc/niagara7-align.c	(.../branches/gcc-7-branch)
+@@ -0,0 +1,4 @@
++/* { dg-do compile } */
++/* { dg-options "-falign-functions -mcpu=niagara7" } */
++/* { dg-final { scan-assembler "\.align 64" } } */
++void foo(void) {}
 Index: gcc/testsuite/gcc.target/i386/pr22152.c
 ===================================================================
 --- a/src/gcc/testsuite/gcc.target/i386/pr22152.c	(.../tags/gcc_7_1_0_release)
@@ -1452,6 +1478,71 @@ Index: gcc/testsuite/gfortran.dg/read_3.f90
 +  read ( unit=str(1:4), fmt='(a)' ) i4
 +  if (i4.ne.256) call abort
 +end  program  gfortran_710_io_bug 
+Index: gcc/testsuite/gfortran.dg/dtio_30.f03
+===================================================================
+--- a/src/gcc/testsuite/gfortran.dg/dtio_30.f03	(.../tags/gcc_7_1_0_release)
++++ b/src/gcc/testsuite/gfortran.dg/dtio_30.f03	(.../branches/gcc-7-branch)
+@@ -0,0 +1,60 @@
++! { dg-do run }
++! PR80333  Namelist dtio write of array of class does not traverse the array
++! This test checks both NAMELIST WRITE and READ of an array of class
++module m
++  implicit none
++  type :: t
++    character :: c
++    character :: d
++  contains
++    procedure :: read_formatted
++    generic :: read(formatted) => read_formatted
++    procedure :: write_formatted
++    generic :: write(formatted) => write_formatted
++  end type t
++contains
++  subroutine read_formatted(dtv, unit, iotype, v_list, iostat, iomsg)
++    class(t), intent(inout) :: dtv
++    integer, intent(in) :: unit
++    character(*), intent(in) :: iotype
++    integer, intent(in) :: v_list(:)
++    integer, intent(out) :: iostat
++    character(*), intent(inout) :: iomsg
++    integer :: i
++    read(unit,'(a1,a1)', iostat=iostat, iomsg=iomsg) dtv%c, dtv%d
++  end subroutine read_formatted
++
++  subroutine write_formatted(dtv, unit, iotype, v_list, iostat, iomsg)
++    class(t), intent(in) :: dtv
++    integer, intent(in) :: unit
++    character(*), intent(in) :: iotype
++    integer, intent(in) :: v_list(:)
++    integer, intent(out) :: iostat
++    character(*), intent(inout) :: iomsg
++    write(unit,'(a1,a1)', iostat=iostat, iomsg=iomsg) dtv%c, dtv%d
++  end subroutine write_formatted
++end module m
++
++program p
++  use m
++  implicit none
++  class(t), dimension(:,:), allocatable :: w
++  namelist /nml/  w
++  integer :: unit, iostatus
++  character(256) :: str = ""
++
++  open(10, status='scratch')
++  allocate(w(10,3))
++  w = t('j','r')
++  w(5:7,2)%c='k'
++  write(10, nml)
++  rewind(10)
++  w = t('p','z')
++  read(10, nml)
++  write(str,*) w
++  if (str.ne." jr jr jr jr jr jr jr jr jr jr jr jr jr jr kr kr kr jr jr jr jr jr jr jr jr jr jr jr jr jr") &
++      & call abort
++  str = ""
++  write(str,"(*(DT))") w
++  if (str.ne."jrjrjrjrjrjrjrjrjrjrjrjrjrjrkrkrkrjrjrjrjrjrjrjrjrjrjrjrjrjr") call abort
++end program p
 Index: gcc/testsuite/gfortran.dg/namelist_93.f90
 ===================================================================
 --- a/src/gcc/testsuite/gfortran.dg/namelist_93.f90	(.../tags/gcc_7_1_0_release)
@@ -1618,6 +1709,46 @@ Index: gcc/testsuite/gfortran.dg/dtio_29.f03
 +     B_type(wage), B_type(wage)
 +   print *, trim(iom)
 +end program test
+Index: gcc/testsuite/gfortran.dg/read_4.f90
+===================================================================
+--- a/src/gcc/testsuite/gfortran.dg/read_4.f90	(.../tags/gcc_7_1_0_release)
++++ b/src/gcc/testsuite/gfortran.dg/read_4.f90	(.../branches/gcc-7-branch)
+@@ -0,0 +1,35 @@
++! { dg-do run }
++! PR80741 wrong code causes incorrect behaviour of namelist READ
++program p
++  use, intrinsic :: iso_fortran_env, only: iostat_end
++  implicit none
++  integer :: x, y, ios, io
++  character(10) :: line
++  namelist /test/ x, y
++  
++  x = 10
++  y = 10
++  ios = 0
++  io = 10
++  open(unit=io, status='scratch')
++  write(io, test)
++  write(io, *) 'done'
++  rewind(io)
++  x = 0
++  y = 0
++  read(io, test)
++  if (x.ne.10 .or. y.ne.10) call abort
++  !
++  read(io, *) line
++  if (line.ne.'done') call abort
++  !
++  read(io, *, iostat=ios) line
++  if (ios/=iostat_end) call abort
++  rewind(io)
++  x = 0
++  y = 0
++  read(io, test)
++  if (x.ne.10 .or. y.ne.10) call abort
++  read(io, *, iostat=ios) line
++  if (line.ne.'done') call abort
++end
 Index: gcc/testsuite/gfortran.dg/namelist_94.f90
 ===================================================================
 --- a/src/gcc/testsuite/gfortran.dg/namelist_94.f90	(.../tags/gcc_7_1_0_release)
@@ -1742,7 +1873,40 @@ Index: gcc/testsuite/ChangeLog
 ===================================================================
 --- a/src/gcc/testsuite/ChangeLog	(.../tags/gcc_7_1_0_release)
 +++ b/src/gcc/testsuite/ChangeLog	(.../branches/gcc-7-branch)
-@@ -1,3 +1,113 @@
+@@ -1,3 +1,146 @@
++2017-05-23  Jerry DeLisle  <jvdelisle at gcc.gnu.org>
++
++	Backport from trunk
++	PR libgfortran/80741
++	* gfortran.dg/read_4.f90: New test.
++
++2017-05-23  Jerry DeLisle  <jvdelisle at gcc.gnu.org>
++
++	Backport from trunk
++	PR libgfortran/80333
++	* gfortran.dg/dtio_30.f03: New test.
++
++2017-05-23  Sheldon Lobo  <sheldon.lobo at oracle.com>
++
++	Backport from mainline
++	2017-05-18  Sheldon Lobo  <sheldon.lobo at oracle.com>
++
++	* gcc.target/sparc/niagara7-align.c: New test.
++
++2017-05-23  Jerry DeLisle  <jvdelisle at gcc.gnu.org>
++
++	Backport from trunk
++	PR libgfortran/80333
++	* gfortran.dg/dtio_30.f03: New test.
++
++2017-05-22  Bill Schmidt  <wschmidt at linux.vnet.ibm.com>
++
++	Backport from mainline
++	2017-05-22  Bill Schmidt  <wschmidt at linux.vnet.ibm.com>
++
++	* gcc.target/powerpc/p8-vec-xl-xst.c: Fix target string to
++	LE-only.
++
 +2017-05-22  Pierre-Marie de Rodat  <derodat at adacore.com>
 +
 +	* gnat.dg/specs/not_null1.ads: New test.
@@ -2802,7 +2966,23 @@ Index: gcc/fortran/ChangeLog
 ===================================================================
 --- a/src/gcc/fortran/ChangeLog	(.../tags/gcc_7_1_0_release)
 +++ b/src/gcc/fortran/ChangeLog	(.../branches/gcc-7-branch)
-@@ -1,3 +1,44 @@
+@@ -1,3 +1,60 @@
++2017-05-23  Jerry DeLisle  <jvdelisle at gcc.gnu.org>
++
++	Backport from trunk
++	PR fortran/80741
++	* trans-io.c (transfer_namelist_element): Change check from
++	NULL_TREE to null_pointer_node.
++
++2017-05-23  Paul Thomas  <pault at gcc.gnu.org>
++
++	Backport from trunk
++	PR fortran/80333
++	* trans-io.c (nml_get_addr_expr): If we are dealing with class
++	type data set tmp tree to get that address.
++	(transfer_namelist_element): Set the array spec to point to the
++	the class data.
++
 +2017-05-17  Jerry DeLisle  <jvdelisle at gcc.gnu.org>
 +
 +	Backport from trunk
@@ -3228,13 +3408,60 @@ Index: gcc/fortran/resolve.c
  
  	  /* Types with private components that came here by USE-association.  */
  	  if (nl->sym->ts.type == BT_DERIVED
-Index: gcc/BASE-VER
+Index: gcc/fortran/trans-io.c
 ===================================================================
---- a/src/gcc/BASE-VER	(.../tags/gcc_7_1_0_release)
-+++ b/src/gcc/BASE-VER	(.../branches/gcc-7-branch)
-@@ -1 +1 @@
--7.1.0
-+7.1.1
+--- a/src/gcc/fortran/trans-io.c	(.../tags/gcc_7_1_0_release)
++++ b/src/gcc/fortran/trans-io.c	(.../branches/gcc-7-branch)
+@@ -1613,6 +1613,10 @@
+     tmp = fold_build3_loc (input_location, COMPONENT_REF, TREE_TYPE (tmp),
+ 			   base_addr, tmp, NULL_TREE);
+ 
++  if (GFC_CLASS_TYPE_P (TREE_TYPE (tmp))
++      && GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (gfc_class_data_get (tmp))))
++    tmp = gfc_class_data_get (tmp);
++
+   if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (tmp)))
+     tmp = gfc_conv_array_data (tmp);
+   else
+@@ -1670,9 +1674,13 @@
+ 
+   /* Build ts, as and data address using symbol or component.  */
+ 
+-  ts = (sym) ? &sym->ts : &c->ts;
+-  as = (sym) ? sym->as : c->as;
++  ts = sym ? &sym->ts : &c->ts;
+ 
++  if (ts->type != BT_CLASS)
++    as = sym ? sym->as : c->as;
++  else
++    as = sym ? CLASS_DATA (sym)->as : CLASS_DATA (c)->as;
++
+   addr_expr = nml_get_addr_expr (sym, c, base_addr);
+ 
+   if (as)
+@@ -1680,9 +1688,12 @@
+ 
+   if (rank)
+     {
+-      decl = (sym) ? sym->backend_decl : c->backend_decl;
++      decl = sym ? sym->backend_decl : c->backend_decl;
+       if (sym && sym->attr.dummy)
+         decl = build_fold_indirect_ref_loc (input_location, decl);
++
++      if (ts->type == BT_CLASS)
++	decl = gfc_class_data_get (decl);
+       dt =  TREE_TYPE (decl);
+       dtype = gfc_get_dtype (dt);
+     }
+@@ -1756,7 +1767,7 @@
+   else
+     tmp = build_int_cst (gfc_charlen_type_node, 0);
+ 
+-  if (dtio_proc == NULL_TREE)
++  if (dtio_proc == null_pointer_node)
+     tmp = build_call_expr_loc (input_location,
+ 			   iocall[IOCALL_SET_NML_VAL], 6,
+ 			   dt_parm_addr, addr_expr, string,
 Index: gcc/alias.c
 ===================================================================
 --- a/src/gcc/alias.c	(.../tags/gcc_7_1_0_release)
@@ -50397,6 +50624,77 @@ Index: gcc/Makefile.in
  	$(AWK) -f $(srcdir)/opt-gather.awk $(ALL_OPT_FILES) > tmp-optionlist
  	$(SHELL) $(srcdir)/../move-if-change tmp-optionlist optionlist
  	$(STAMP) s-options
+Index: gcc/config/sparc/sparc.c
+===================================================================
+--- a/src/gcc/config/sparc/sparc.c	(.../tags/gcc_7_1_0_release)
++++ b/src/gcc/config/sparc/sparc.c	(.../branches/gcc-7-branch)
+@@ -1528,15 +1528,18 @@
+     target_flags |= MASK_LRA;
+ 
+   /* Supply a default value for align_functions.  */
+-  if (align_functions == 0
+-      && (sparc_cpu == PROCESSOR_ULTRASPARC
++  if (align_functions == 0)
++    {
++      if (sparc_cpu == PROCESSOR_ULTRASPARC
+ 	  || sparc_cpu == PROCESSOR_ULTRASPARC3
+ 	  || sparc_cpu == PROCESSOR_NIAGARA
+ 	  || sparc_cpu == PROCESSOR_NIAGARA2
+ 	  || sparc_cpu == PROCESSOR_NIAGARA3
+-	  || sparc_cpu == PROCESSOR_NIAGARA4
+-	  || sparc_cpu == PROCESSOR_NIAGARA7))
+-    align_functions = 32;
++	  || sparc_cpu == PROCESSOR_NIAGARA4)
++	align_functions = 32;
++      else if (sparc_cpu == PROCESSOR_NIAGARA7)
++	align_functions = 64;
++    }
+ 
+   /* Validate PCC_STRUCT_RETURN.  */
+   if (flag_pcc_struct_return == DEFAULT_PCC_STRUCT_RETURN)
+Index: gcc/config/sparc/sparc.h
+===================================================================
+--- a/src/gcc/config/sparc/sparc.h	(.../tags/gcc_7_1_0_release)
++++ b/src/gcc/config/sparc/sparc.h	(.../branches/gcc-7-branch)
+@@ -1566,8 +1566,11 @@
+    and annulled branches insert 4 bubbles.
+ 
+    On Niagara-2 and Niagara-3, a not-taken branch costs 1 cycle whereas
+-   a taken branch costs 6 cycles.  */
++   a taken branch costs 6 cycles.
+ 
++   The T4 Supplement specifies the branch latency at 2 cycles.
++   The M7 Supplement specifies the branch latency at 1 cycle. */
++
+ #define BRANCH_COST(speed_p, predictable_p) \
+ 	((sparc_cpu == PROCESSOR_V9 \
+ 	  || sparc_cpu == PROCESSOR_ULTRASPARC) \
+@@ -1579,7 +1582,11 @@
+ 	 : ((sparc_cpu == PROCESSOR_NIAGARA2 \
+ 	     || sparc_cpu == PROCESSOR_NIAGARA3) \
+ 	    ? 5 \
+-	 : 3))))
++	 : (sparc_cpu == PROCESSOR_NIAGARA4 \
++	    ? 2 \
++	 : (sparc_cpu == PROCESSOR_NIAGARA7 \
++	    ? 1 \
++	 : 3))))))
+ 

+ /* Control the assembler format that we output.  */
+ 
+Index: gcc/config/sparc/sol2.h
+===================================================================
+--- a/src/gcc/config/sparc/sol2.h	(.../tags/gcc_7_1_0_release)
++++ b/src/gcc/config/sparc/sol2.h	(.../branches/gcc-7-branch)
+@@ -169,7 +169,7 @@
+ #undef CPP_CPU64_DEFAULT_SPEC
+ #define CPP_CPU64_DEFAULT_SPEC ""
+ #undef ASM_CPU32_DEFAULT_SPEC
+-#define ASM_CPU32_DEFAUILT_SPEC AS_SPARC32_FLAG AS_NIAGARA7_FLAG
++#define ASM_CPU32_DEFAULT_SPEC AS_SPARC32_FLAG AS_NIAGARA7_FLAG
+ #undef ASM_CPU64_DEFAULT_SPEC
+ #define ASM_CPU64_DEFAULT_SPEC AS_SPARC64_FLAG AS_NIAGARA7_FLAG
+ #endif
 Index: gcc/config/i386/mmx.md
 ===================================================================
 --- a/src/gcc/config/i386/mmx.md	(.../tags/gcc_7_1_0_release)
@@ -51017,7 +51315,26 @@ Index: libgfortran/ChangeLog
 ===================================================================
 --- a/src/libgfortran/ChangeLog	(.../tags/gcc_7_1_0_release)
 +++ b/src/libgfortran/ChangeLog	(.../branches/gcc-7-branch)
-@@ -1,3 +1,19 @@
+@@ -1,3 +1,38 @@
++2017-05-23  Jerry DeLisle  <jvdelisle at gcc.gnu.org>
++
++	Backport from trunk
++	PR libgfortran/80741
++	* transfer.c (finalize_transfer): Reset last_char to 'empty'.
++	* file_pos.c (formatted_backspace): Likewise.
++	(st_endfile): Likewise.
++	(st_rewind): Likewise.
++	(st_flush): Likewise.
++
++2017-05-23  Paul Thomas  <pault at gcc.gnu.org>
++	    Jerry DeLisle  <jvdelisle at gcc.gnu.org>
++
++	Backport from trunk
++	PR fortran/80333
++	* list_read.c (nml_read_obj): Compute pointer into class/type
++	arrays from the nl->dim information. Update it for each iteration
++	of the loop for the given object.
++
 +2017-05-19  Janne Blomqvist  <jb at gcc.gnu.org>
 +
 +	Backport from trunk
@@ -51052,6 +51369,120 @@ Index: libgfortran/libgfortran.h
    && defined(HAVE_GETGID) && defined(HAVE_GETEGID)
  #define FALLBACK_SECURE_GETENV
  extern char *secure_getenv (const char *);
+Index: libgfortran/io/file_pos.c
+===================================================================
+--- a/src/libgfortran/io/file_pos.c	(.../tags/gcc_7_1_0_release)
++++ b/src/libgfortran/io/file_pos.c	(.../branches/gcc-7-branch)
+@@ -82,7 +82,7 @@
+     goto io_error;
+   u->last_record--;
+   u->endfile = NO_ENDFILE;
+-
++  u->last_char = EOF - 1;
+   return;
+ 
+  io_error:
+@@ -322,6 +322,7 @@
+ 
+       unit_truncate (u, stell (u->s), &fpp->common);
+       u->endfile = AFTER_ENDFILE;
++      u->last_char = EOF - 1;
+       if (0 == stell (u->s))
+         u->flags.position = POSITION_REWIND;
+     }
+@@ -371,6 +372,7 @@
+ 	  if (u == NULL)
+ 	    return;
+ 	  u->endfile = AFTER_ENDFILE;
++	  u->last_char = EOF - 1;
+ 	}
+     }
+ 
+@@ -430,6 +432,7 @@
+ 	  u->current_record = 0;
+ 	  u->strm_pos = 1;
+ 	  u->read_bad = 0;
++	  u->last_char = EOF - 1;
+ 	}
+       /* Update position for INQUIRE.  */
+       u->flags.position = POSITION_REWIND;
+@@ -458,6 +461,7 @@
+         fbuf_flush (u, u->mode);
+ 
+       sflush (u->s);
++      u->last_char = EOF - 1;
+       unlock_unit (u);
+     }
+   else
+Index: libgfortran/io/list_read.c
+===================================================================
+--- a/src/libgfortran/io/list_read.c	(.../tags/gcc_7_1_0_release)
++++ b/src/libgfortran/io/list_read.c	(.../branches/gcc-7-branch)
+@@ -2871,6 +2871,7 @@
+   index_type m;
+   size_t obj_name_len;
+   void *pdata;
++  gfc_class list_obj;
+ 
+   /* If we have encountered a previous read error or this object has not been
+      touched in name parsing, just return.  */
+@@ -2909,12 +2910,29 @@
+     {
+       /* Update the pointer to the data, using the current index vector  */
+ 
+-      pdata = (void*)(nl->mem_pos + offset);
+-      for (dim = 0; dim < nl->var_rank; dim++)
+-	pdata = (void*)(pdata + (nl->ls[dim].idx
+-				 - GFC_DESCRIPTOR_LBOUND(nl,dim))
+-			* GFC_DESCRIPTOR_STRIDE(nl,dim) * nl->size);
++      if ((nl->type == BT_DERIVED || nl->type == BT_CLASS)
++	  && nl->dtio_sub != NULL)
++	{
++	  pdata = NULL;  /* Not used under these conidtions.  */
++	  if (nl->type == BT_CLASS)
++	    list_obj.data = ((gfc_class*)nl->mem_pos)->data;
++	  else
++	    list_obj.data = (void *)nl->mem_pos;
+ 
++	  for (dim = 0; dim < nl->var_rank; dim++)
++	    list_obj.data = list_obj.data + (nl->ls[dim].idx
++	      - GFC_DESCRIPTOR_LBOUND(nl,dim))
++	      * GFC_DESCRIPTOR_STRIDE(nl,dim) * nl->size;
++	}
++      else
++	{
++	  pdata = (void*)(nl->mem_pos + offset);
++	  for (dim = 0; dim < nl->var_rank; dim++)
++	    pdata = (void*)(pdata + (nl->ls[dim].idx
++	      - GFC_DESCRIPTOR_LBOUND(nl,dim))
++	      * GFC_DESCRIPTOR_STRIDE(nl,dim) * nl->size);
++	}
++
+       /* If we are finished with the repeat count, try to read next value.  */
+ 
+       nml_carry = 0;
+@@ -2958,6 +2976,7 @@
+ 	    break;
+ 
+ 	  case BT_DERIVED:
++	  case BT_CLASS:
+ 	    /* If this object has a User Defined procedure, call it.  */
+ 	    if (nl->dtio_sub != NULL)
+ 	      {
+@@ -2970,13 +2989,11 @@
+ 		int noiostat;
+ 		int *child_iostat = NULL;
+ 		gfc_array_i4 vlist;
+-		gfc_class list_obj;
+ 		formatted_dtio dtio_ptr = (formatted_dtio)nl->dtio_sub;
+ 
+ 		GFC_DESCRIPTOR_DATA(&vlist) = NULL;
+ 		GFC_DIMENSION_SET(vlist.dim[0],1, 0, 0);
+ 
+-		list_obj.data = (void *)nl->mem_pos;
+ 		list_obj.vptr = nl->vtable;
+ 		list_obj.len = 0;
+ 
 Index: libgfortran/io/transfer.c
 ===================================================================
 --- a/src/libgfortran/io/transfer.c	(.../tags/gcc_7_1_0_release)
@@ -51099,3 +51530,12 @@ Index: libgfortran/io/transfer.c
  
  	  *nbytes = dtp->u.p.current_unit->bytes_left;
  	}
+@@ -3970,7 +3977,7 @@
+       fbuf_seek (dtp->u.p.current_unit, 0, SEEK_END);
+ 
+   dtp->u.p.current_unit->saved_pos = 0;
+-
++  dtp->u.p.current_unit->last_char = EOF - 1;
+   next_record (dtp, 1);
+ 
+  done:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/gcc-7.git



More information about the Reproducible-commits mailing list