[gcc-7] 335/354: * Update to SVN 20171109 (r254567) from the gcc-7-branch.

Ximin Luo infinity0 at debian.org
Thu Nov 23 15:51:40 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 b83b9c66c89e80ee7d70c4d41f3e217be18770b6
Author: doko <doko at 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca>
Date:   Thu Nov 9 11:14:14 2017 +0000

      * Update to SVN 20171109 (r254567) from the gcc-7-branch.
    
    
    git-svn-id: svn+ssh://svn.debian.org/svn/gcccvs/branches/sid/gcc-7@9808 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca
---
 debian/changelog                |  10 +-
 debian/patches/svn-updates.diff | 960 ++++++++++++++++++++++++++++++++++++++--
 2 files changed, 939 insertions(+), 31 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index f7167ac..0d42557 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,15 +1,19 @@
 gcc-7 (7.2.0-13) UNRELEASED; urgency=medium
 
-  * Update to SVN 20171102 (r254339) from the gcc-7-branch.
+  * Update to SVN 20171109 (r254567) from the gcc-7-branch.
     - Fix PR c++/82159, PR sanitizer/81715, PR rtl-optimization/82192,
       PR c/82234, PR target/82703 (x86), PR c++/82085, PR c++/82373,
       PR fortran/81758, PR libgfortran/81938, PR c++/81702, PR target/82772,
-      PR fortran/80554, PR fortran/80850.
+      PR fortran/80554, PR fortran/80850, PR libgcc/82635,
+      PR rtl-optimization/64682, PR rtl-optimization/69567,
+      PR rtl-optimization/69737, PR rtl-optimization/82683,
+      PR rtl-optimization/81803, PR middle-end/60580, PR fortran/78641,
+      PR fortran/69739, PR fortran/82796, PR fortran/81735.
     - Fix subminor version number. Closes: #879823.
   * Bump libunwind (build-)dependency for ia64. Closes: #879959.
   * libgcc and libstdc++ symbols files updates for mipsn32.
 
- -- Matthias Klose <doko at debian.org>  Thu, 02 Nov 2017 11:45:49 +0100
+ -- Matthias Klose <doko at debian.org>  Thu, 09 Nov 2017 11:56:16 +0100
 
 gcc-7 (7.2.0-12) unstable; urgency=medium
 
diff --git a/debian/patches/svn-updates.diff b/debian/patches/svn-updates.diff
index 635cd76..c211641 100644
--- a/debian/patches/svn-updates.diff
+++ b/debian/patches/svn-updates.diff
@@ -1,10 +1,10 @@
-# DP: updates from the 7 branch upto 20171102 (r254339).
+# DP: updates from the 7 branch upto 20171109 (r254567).
 
 last_update()
 {
 	cat > ${dir}LAST_UPDATED <EOF
-Thu Nov  2 11:44:14 CET 2017
-Thu Nov  2 10:44:14 UTC 2017 (revision 254339)
+Thu Nov  9 11:55:34 CET 2017
+Thu Nov  9 10:55:34 UTC 2017 (revision 254567)
 EOF
 }
 
@@ -9718,7 +9718,18 @@ Index: libgcc/ChangeLog
 ===================================================================
 --- a/src/libgcc/ChangeLog	(.../tags/gcc_7_2_0_release)
 +++ b/src/libgcc/ChangeLog	(.../branches/gcc-7-branch)
-@@ -1,3 +1,18 @@
+@@ -1,3 +1,29 @@
++2017-11-05  Andreas Tobler  <andreast at gcc.gnu.org>
++
++	Backport from mainline
++	2017-11-04  Andreas Tobler  <andreast at gcc.gnu.org>
++
++	PR libgcc/82635
++	* config/i386/freebsd-unwind.h (MD_FALLBACK_FRAME_STATE_FOR): Use a
++	sysctl to determine whether we're in a trampoline.
++	Keep the pattern matching method for systems without
++	KERN_PROC_SIGTRAMP sysctl.
++
 +2017-10-13  Jakub Jelinek  <jakub at redhat.com>
 +
 +	PR target/82274
@@ -9737,6 +9748,86 @@ Index: libgcc/ChangeLog
  2017-08-14  Release Manager
  
  	* GCC 7.2.0 released.
+Index: libgcc/config/i386/freebsd-unwind.h
+===================================================================
+--- a/src/libgcc/config/i386/freebsd-unwind.h	(.../tags/gcc_7_2_0_release)
++++ b/src/libgcc/config/i386/freebsd-unwind.h	(.../branches/gcc-7-branch)
+@@ -28,7 +28,10 @@
+ 
+ #include <sys/types.h>
+ #include <signal.h>
++#include <unistd.h>
++#include <sys/sysctl.h>
+ #include <sys/ucontext.h>
++#include <sys/user.h>
+ #include <machine/sigframe.h>
+ 
+ #define REG_NAME(reg)	sf_uc.uc_mcontext.mc_## reg
+@@ -36,6 +39,38 @@
+ #ifdef __x86_64__
+ #define MD_FALLBACK_FRAME_STATE_FOR x86_64_freebsd_fallback_frame_state
+ 
++#ifdef KERN_PROC_SIGTRAMP
++/* FreeBSD past 9.3 provides a kern.proc.sigtramp.<pid> sysctl that
++   returns the location of the signal trampoline. Use this to find
++   out whether we're in a trampoline.
++*/
++static int
++x86_64_outside_sigtramp_range (unsigned char *pc)
++{
++  static int sigtramp_range_determined = 0;
++  static unsigned char *sigtramp_start, *sigtramp_end;
++
++  if (sigtramp_range_determined == 0)
++    {
++      struct kinfo_sigtramp kst = {0};
++      size_t len = sizeof (kst);
++      int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_SIGTRAMP, getpid() };
++
++      sigtramp_range_determined = 1;
++      if (sysctl (mib, 4, &kst, &len, NULL, 0) == 0)
++      {
++        sigtramp_range_determined = 2;
++        sigtramp_start = kst.ksigtramp_start;
++        sigtramp_end   = kst.ksigtramp_end;
++      }
++    }
++  if (sigtramp_range_determined < 2)  /* sysctl failed if < 2 */
++    return 1;
++
++  return (pc < sigtramp_start || pc >= sigtramp_end);
++}
++#endif
++
+ static _Unwind_Reason_Code
+ x86_64_freebsd_fallback_frame_state
+ (struct _Unwind_Context *context, _Unwind_FrameState *fs)
+@@ -43,6 +78,7 @@
+   struct sigframe *sf;
+   long new_cfa;
+ 
++#ifndef KERN_PROC_SIGTRAMP
+   /* Prior to FreeBSD 9, the signal trampoline was located immediately
+      before the ps_strings.  To support non-executable stacks on AMD64,
+      the sigtramp was moved to a shared page for FreeBSD 9.  Unfortunately
+@@ -62,12 +98,15 @@
+         && *(unsigned int *)(context->ra +  8) == 0x01a1c0c7
+         && *(unsigned int *)(context->ra + 12) == 0x050f0000 ))
+     return _URC_END_OF_STACK;
++#else
++  if (x86_64_outside_sigtramp_range(context->ra))
++    return _URC_END_OF_STACK;
++#endif
+ 
+   sf = (struct sigframe *) context->cfa;
+   new_cfa = sf->REG_NAME(rsp);
+   fs->regs.cfa_how = CFA_REG_OFFSET;
+-  /* Register 7 is rsp  */
+-  fs->regs.cfa_reg = 7;
++  fs->regs.cfa_reg =  __LIBGCC_STACK_POINTER_REGNUM__;
+   fs->regs.cfa_offset = new_cfa - (long) context->cfa;
+ 
+   /* The SVR4 register numbering macros aren't usable in libgcc.  */
 Index: libgcc/libgcc2.c
 ===================================================================
 --- a/src/libgcc/libgcc2.c	(.../tags/gcc_7_2_0_release)
@@ -10155,7 +10246,7 @@ Index: gcc/DATESTAMP
 +++ b/src/gcc/DATESTAMP	(.../branches/gcc-7-branch)
 @@ -1 +1 @@
 -20170814
-+20171102
++20171109
 Index: gcc/tree.c
 ===================================================================
 --- a/src/gcc/tree.c	(.../tags/gcc_7_2_0_release)
@@ -10729,7 +10820,40 @@ Index: gcc/ChangeLog
 ===================================================================
 --- a/src/gcc/ChangeLog	(.../tags/gcc_7_2_0_release)
 +++ b/src/gcc/ChangeLog	(.../branches/gcc-7-branch)
-@@ -1,3 +1,742 @@
+@@ -1,3 +1,775 @@
++2017-11-09  Segher Boessenkool  <segher at kernel.crashing.org>
++
++	Backport from mainline
++	2017-11-01  Segher Boessenkool  <segher at kernel.crashing.org>
++
++	PR rtl-optimization/64682
++	PR rtl-optimization/69567
++	PR rtl-optimization/69737
++	PR rtl-optimization/82683
++	* combine.c (distribute_notes) <REG_DEAD>: If the new I2 sets the same
++	register mentioned in the note, drop the note, unless it came from I3,
++	in which case it should go to I3 again.
++
++2017-11-07  Eric Botcazou  <ebotcazou at adacore.com>
++
++	Backport from mainline
++	2017-10-31  Matthew Fortune  <matthew.fortune at imgtec.com>
++                    Eric Botcazou  <ebotcazou at adacore.com>
++
++	PR rtl-optimization/81803
++	* lra-constraints.c (curr_insn_transform): Also reload the whole
++	register for a strict subreg no wider than a word if this is for
++	a WORD_REGISTER_OPERATIONS target.
++
++2017-11-03  Wilco Dijkstra  <wdijkstr at arm.com>
++
++	PR middle-end/60580
++	* config/aarch64/aarch64.c (aarch64_frame_pointer_required)
++	Check special value of flag_omit_frame_pointer.
++	(aarch64_can_eliminate): Likewise.
++	(aarch64_override_options_after_change_1): Simplify handling of
++	-fomit-frame-pointer and -fomit-leaf-frame-pointer.
++
 +2017-11-01  Martin Jambor  <mjambor at suse.cz>
 +
 +	PR c++/81702
@@ -11472,6 +11596,27 @@ Index: gcc/ChangeLog
  2017-08-14  Release Manager
  
  	* GCC 7.2.0 released.
+@@ -5411,11 +6187,6 @@
+ 	* doc/invoke.texi: Replace inequality signs with square brackets
+ 	for -Wnormalized.
+ 
+-2017-02-22  Bill Schmidt  <wschmidt at linux.vnet.ibm.com>
+-
+-	PR tree-optimization/68644
+-	* gcc.dg/tree-ssa/ivopts-lt-2.c: Skip for powerpc*-*-*.
+-
+ 2017-02-22  Matthew Fortune  <matthew.fortune at imgtec.com>
+ 
+ 	PR target/78660
+@@ -6987,8 +7758,6 @@
+ 	* tree-vrp.c (process_assert_insertions): Properly adjust common
+ 	when removing a duplicate.
+ 
+-	* gcc.dg/torture/pr79276.c: New testcase.
+-
+ 2017-01-30  Richard Biener  <rguenther at suse.de>
+ 
+ 	PR tree-optimization/79256
 Index: gcc/testsuite/gcc.target/powerpc/pr81833-1.c
 ===================================================================
 --- a/src/gcc/testsuite/gcc.target/powerpc/pr81833-1.c	(.../tags/gcc_7_2_0_release)
@@ -12735,6 +12880,75 @@ Index: gcc/testsuite/gfortran.dg/class_64.f90
 +
 +end
 +! { dg-final { scan-tree-dump-times "arg.*._len" 1 "original" } }
+Index: gcc/testsuite/gfortran.dg/auto_dealloc_1.f90
+===================================================================
+--- a/src/gcc/testsuite/gfortran.dg/auto_dealloc_1.f90	(.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/gfortran.dg/auto_dealloc_1.f90	(.../branches/gcc-7-branch)
+@@ -50,7 +50,7 @@
+     m%k%i = 45
+   end subroutine
+ 
+-end module 
++end module
+ 
+ 
+-! { dg-final { scan-tree-dump-times "__builtin_free" 4 "original" } }
++! { dg-final { scan-tree-dump-times "__builtin_free" 10 "original" } }
+Index: gcc/testsuite/gfortran.dg/equiv_pure.f90
+===================================================================
+--- a/src/gcc/testsuite/gfortran.dg/equiv_pure.f90	(.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/gfortran.dg/equiv_pure.f90	(.../branches/gcc-7-branch)
+@@ -0,0 +1,50 @@
++! { dg-do compile }
++module eq
++   implicit none
++   integer :: n1, n2
++   integer, dimension(2) :: a
++   equivalence (a(1), n1)
++   equivalence (a(2), n2)
++   common /a/ a
++end module eq
++
++module m
++   use eq
++   implicit none
++   type, public :: t
++     integer :: i
++   end type t
++end module m
++
++module p
++   implicit none
++   contains
++   pure integer function d(h)
++     use m
++     implicit none
++     integer, intent(in) :: h
++     d = h
++   end function
++end module p
++
++module q
++   implicit none
++   contains
++   pure integer function d(h)
++     use m, only : t
++     implicit none
++     integer, intent(in) :: h
++     d = h
++   end function
++end module q
++
++module r
++   implicit none
++   contains
++   pure integer function d(h)
++     use m, only : a          ! { dg-error "cannot be an EQUIVALENCE object" }
++     implicit none
++     integer, intent(in) :: h
++     d = h
++   end function
++end module r
 Index: gcc/testsuite/gfortran.dg/dtio_12.f90
 ===================================================================
 --- a/src/gcc/testsuite/gfortran.dg/dtio_12.f90	(.../tags/gcc_7_2_0_release)
@@ -12869,6 +13083,37 @@ Index: gcc/testsuite/gfortran.dg/class_63.f90
 +  if (x%get_vector_value() .ne. 99) call abort
 +  if (x%get_pointer_value() .ne. 99) call abort
 +end
+Index: gcc/testsuite/gfortran.dg/typebound_proc_27.f03
+===================================================================
+--- a/src/gcc/testsuite/gfortran.dg/typebound_proc_27.f03	(.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/gfortran.dg/typebound_proc_27.f03	(.../branches/gcc-7-branch)
+@@ -1,6 +1,6 @@
+ ! { dg-do run }
+ ! { dg-options "-fdump-tree-original" }
+-! 
++!
+ ! PR fortran/47586
+ ! Missing deep copy for data pointer returning functions when the type
+ ! has allocatable components
+@@ -77,15 +77,15 @@
+ ! statements.
+ ! It is assumed that if the number of allocate is right, the number of
+ ! deep copies is right too.
+-! { dg-final { scan-tree-dump-times "__builtin_malloc" 12 "original" } }
++! { dg-final { scan-tree-dump-times "__builtin_malloc" 15 "original" } }
+ 
+ !
+ ! Realloc are only used for assignments to `that%i'.  Don't know why.
+ ! { dg-final { scan-tree-dump-times "__builtin_realloc" 6 "original" } }
+-! 
++!
+ 
+ ! No leak: Only assignments to `this' use malloc.  Assignments to `that%i'
+ ! take the realloc path after the first assignment, so don't count as a malloc.
+-! { dg-final { scan-tree-dump-times "__builtin_free" 7 "original" } }
++! { dg-final { scan-tree-dump-times "__builtin_free" 10 "original" } }
+ !
+ 
 Index: gcc/testsuite/gfortran.dg/assumed_size_2.f90
 ===================================================================
 --- a/src/gcc/testsuite/gfortran.dg/assumed_size_2.f90	(.../tags/gcc_7_2_0_release)
@@ -12878,6 +13123,36 @@ Index: gcc/testsuite/gfortran.dg/assumed_size_2.f90
 +subroutine foo(a)
 +  dimension  a(*,*) ! { dg-error "Bad specification for assumed size array" }
 +end
+Index: gcc/testsuite/gfortran.dg/pr81735.f90
+===================================================================
+--- a/src/gcc/testsuite/gfortran.dg/pr81735.f90	(.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/gfortran.dg/pr81735.f90	(.../branches/gcc-7-branch)
+@@ -0,0 +1,25 @@
++! { dg-do compile }
++! { dg-options "-fdump-tree-original" }
++!
++! Contributed by Danila  <flashmozzg at gmail.com>
++!
++program fooprog
++    implicit none
++    type FooType
++        integer, allocatable :: x
++    end type FooType
++
++    type(FooType), pointer :: bar
++
++    bar => foo()
++
++contains
++    function foo() result(res)
++        type(FooType), pointer :: res
++
++        character(:), allocatable :: rt
++        rt = ""
++        res => null()
++    end function foo
++end program fooprog
++! { dg-final { scan-tree-dump-times "__builtin_free" 1 "original" } }
 Index: gcc/testsuite/gfortran.dg/associate_29.f90
 ===================================================================
 --- a/src/gcc/testsuite/gfortran.dg/associate_29.f90	(.../tags/gcc_7_2_0_release)
@@ -12913,6 +13188,39 @@ Index: gcc/testsuite/gfortran.dg/associate_29.f90
 +    NORMCHAR(1)='SVLTTC'
 +  END ASSOCIATE
 +END SUBROUTINE SUCDDH
+Index: gcc/testsuite/gfortran.dg/class_66.f90
+===================================================================
+--- a/src/gcc/testsuite/gfortran.dg/class_66.f90	(.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/gfortran.dg/class_66.f90	(.../branches/gcc-7-branch)
+@@ -0,0 +1,28 @@
++! { dg- do run }
++!
++! Test the fix for PR78641 in which an ICE occured on assignment
++! of a class array constructor to a derived type array.
++!
++! Contributed by Damian Rouson  <damian at sourceryinstitute.org>
++!
++  implicit none
++  type foo
++    integer :: i = 99
++  end type
++  type(foo) :: bar(4)
++  class(foo), allocatable :: barfoo
++
++  allocate(barfoo,source = f(11))
++  bar = [f(33), [f(22), barfoo], f(1)]
++  if (any (bar%i .ne. [33, 22, 11, 1])) call abort
++  deallocate (barfoo)
++
++contains
++
++  function f(arg) result(foobar)
++    class(foo), allocatable :: foobar
++    integer :: arg
++    allocate(foobar,source = foo(arg))
++  end function
++
++end program
 Index: gcc/testsuite/gfortran.dg/array_temporaries_4.f90
 ===================================================================
 --- a/src/gcc/testsuite/gfortran.dg/array_temporaries_4.f90	(.../tags/gcc_7_2_0_release)
@@ -13057,6 +13365,60 @@ Index: gcc/testsuite/gfortran.dg/associate_9.f03
  END PROGRAM main
 -
 -! { dg-excess-errors "Syntex error in IF" }
+Index: gcc/testsuite/gfortran.dg/finalize_28.f90
+===================================================================
+--- a/src/gcc/testsuite/gfortran.dg/finalize_28.f90	(.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/gfortran.dg/finalize_28.f90	(.../branches/gcc-7-branch)
+@@ -21,4 +21,4 @@
+     integer, intent(out) :: edges(:,:)
+   end subroutine coo_dump_edges
+ end module coo_graphs
+-! { dg-final { scan-tree-dump-times "__builtin_free" 3 "original" } }
++! { dg-final { scan-tree-dump-times "__builtin_free" 6 "original" } }
+Index: gcc/testsuite/gfortran.dg/pr69739.f90
+===================================================================
+--- a/src/gcc/testsuite/gfortran.dg/pr69739.f90	(.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/gfortran.dg/pr69739.f90	(.../branches/gcc-7-branch)
+@@ -0,0 +1,39 @@
++! { dg-do run }
++!
++! Test the fix for PR69739 in which the statement
++! R = operate(A, X) caused an ICE.
++!
++! Contributed by John  <jwmwalrus at gmail.com>
++!
++module test
++
++  implicit none
++  type, public :: sometype
++    real :: a    =  0.
++  end type
++contains
++
++  function dosomething(A) result(r)
++    type(sometype), intent(IN) :: A(:,:,:)
++    integer :: N
++    real, allocatable ::   R(:), X(:)
++
++    N = PRODUCT(UBOUND(A))
++    allocate (R(N),X(N))
++    X = [(real(N), N = 1, size(X, 1))]
++    R = operate(A, X)
++  end function
++
++  function operate(A, X)
++    type(sometype), intent(IN) :: A(:,:,:)
++    real, intent(IN) :: X(:)
++    real :: operate(1:PRODUCT(UBOUND(A)))
++
++    operate = x
++  end function
++end module test
++
++  use test
++  type(sometype) :: a(2, 2, 2)
++  if (any(int (dosomething(a)) .ne. [1,2,3,4,5,6])) call abort
++end
 Index: gcc/testsuite/gfortran.dg/associate_28.f90
 ===================================================================
 --- a/src/gcc/testsuite/gfortran.dg/associate_28.f90	(.../tags/gcc_7_2_0_release)
@@ -13126,6 +13488,75 @@ Index: gcc/testsuite/gfortran.dg/associate_28.f90
 +  tb%TT_A=>ta
 +  call tb%setpt()
 +End Program Test
+Index: gcc/testsuite/gfortran.dg/class_65.f90
+===================================================================
+--- a/src/gcc/testsuite/gfortran.dg/class_65.f90	(.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/gfortran.dg/class_65.f90	(.../branches/gcc-7-branch)
+@@ -0,0 +1,41 @@
++! { dg-do run }
++!
++! Test the fix for PR81447 in which a vtable was not being created
++! in the module 'm' so that x->vptr in 's' did not have the same
++! value as that in 'p'.
++!
++! Contributed by Mat Cross  <mathewc at nag.co.uk>
++!
++Module m
++  Type :: t
++    integer :: i
++  End Type
++End Module
++
++Program p
++  Use m
++  Class (t), Allocatable :: x
++  Interface
++    Subroutine s(x)
++      Use m
++      Class (t), Allocatable :: x
++    End Subroutine
++  End Interface
++  Call s(x)
++  Select Type (x)
++  Type Is (t)
++    Continue
++  Class Is (t)
++    call abort
++  Class Default
++    call abort
++  End Select
++!  Print *, 'ok'
++End Program
++
++Subroutine s(x)
++  Use m, Only: t
++  Implicit None
++  Class (t), Allocatable :: x
++  Allocate (t :: x)
++End Subroutine
+Index: gcc/testsuite/gfortran.dg/coarray_lib_realloc_1.f90
+===================================================================
+--- a/src/gcc/testsuite/gfortran.dg/coarray_lib_realloc_1.f90	(.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/gfortran.dg/coarray_lib_realloc_1.f90	(.../branches/gcc-7-branch)
+@@ -21,14 +21,14 @@
+ end
+ 
+ ! For comp%ii: End of scope of x + y (2x) and for the LHS of the assignment (1x)
+-! { dg-final { scan-tree-dump-times "__builtin_free" 3 "original" } }
++! { dg-final { scan-tree-dump-times "__builtin_free" 6 "original" } }
+ 
+ ! For comp%CAF:  End of scope of x + y (2x); no LHS freeing for the CAF in assignment
+-! { dg-final { scan-tree-dump-times "_gfortran_caf_deregister" 2 "original" } }
++! { dg-final { scan-tree-dump-times "_gfortran_caf_deregister" 3 "original" } }
+ 
+ ! Only malloc "ii":
+-! { dg-final { scan-tree-dump-times "__builtin_malloc" 1 "original" } }
++! { dg-final { scan-tree-dump-times "__builtin_malloc" 4 "original" } }
+ 
+ ! But copy "ii" and "CAF":
+-! { dg-final { scan-tree-dump-times "__builtin_memcpy|= MEM" 2 "original" } }
++! { dg-final { scan-tree-dump-times "__builtin_memcpy|= MEM" 5 "original" } }
+ 
 Index: gcc/testsuite/gfortran.dg/zero_sized_7.f90
 ===================================================================
 --- a/src/gcc/testsuite/gfortran.dg/zero_sized_7.f90	(.../tags/gcc_7_2_0_release)
@@ -13149,6 +13580,75 @@ Index: gcc/testsuite/gfortran.dg/zero_sized_7.f90
 + end subroutine sub
 +
 +end module m
+Index: gcc/testsuite/gfortran.dg/coarray/send_char_array_1.f90
+===================================================================
+--- a/src/gcc/testsuite/gfortran.dg/coarray/send_char_array_1.f90	(.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/gfortran.dg/coarray/send_char_array_1.f90	(.../branches/gcc-7-branch)
+@@ -0,0 +1,54 @@
++!{ dg-do run }
++ 
++program send_convert_char_array
++
++  implicit none
++
++  character(kind=1, len=:), allocatable, codimension[:] :: co_str_k1_scal
++  character(kind=1, len=:), allocatable :: str_k1_scal
++  character(kind=4, len=:), allocatable, codimension[:] :: co_str_k4_scal
++  character(kind=4, len=:), allocatable :: str_k4_scal
++
++  character(kind=1, len=:), allocatable, codimension[:] :: co_str_k1_arr(:)
++  character(kind=1, len=:), allocatable :: str_k1_arr(:)
++  character(kind=4, len=:), allocatable, codimension[:] :: co_str_k4_arr(:)
++  character(kind=4, len=:), allocatable :: str_k4_arr(:)
++
++  allocate(str_k1_scal, SOURCE='abcdefghij')
++  allocate(str_k4_scal, SOURCE=4_'abcdefghij')
++  allocate(character(len=20)::co_str_k1_scal[*]) ! allocate syncs here
++  allocate(character(kind=4, len=20)::co_str_k4_scal[*]) ! allocate syncs here
++
++  allocate(str_k1_arr, SOURCE=['abc', 'EFG', 'klm', 'NOP'])
++  allocate(str_k4_arr, SOURCE=[4_'abc', 4_'EFG', 4_'klm', 4_'NOP'])
++  allocate(character(len=5)::co_str_k1_arr(4)[*])
++  allocate(character(kind=4, len=5)::co_str_k4_arr(4)[*])
++
++  ! First check send/copy to self
++  co_str_k1_scal[1] = str_k1_scal
++  if (co_str_k1_scal /= str_k1_scal // '          ') call abort()
++
++  co_str_k4_scal[1] = str_k4_scal
++  if (co_str_k4_scal /= str_k4_scal // 4_'          ') call abort()
++
++  co_str_k4_scal[1] = str_k1_scal
++  if (co_str_k4_scal /= str_k4_scal // 4_'          ') call abort()
++
++  co_str_k1_scal[1] = str_k4_scal
++  if (co_str_k1_scal /= str_k1_scal // '          ') call abort()
++
++  co_str_k1_arr(:)[1] = str_k1_arr
++  if (any(co_str_k1_arr /= ['abc  ', 'EFG  ', 'klm  ', 'NOP  '])) call abort()
++ 
++  co_str_k4_arr(:)[1] = [4_'abc', 4_'EFG', 4_'klm', 4_'NOP']! str_k4_arr
++  if (any(co_str_k4_arr /= [4_'abc  ', 4_'EFG  ', 4_'klm  ', 4_'NOP  '])) call abort()
++
++  co_str_k4_arr(:)[1] = str_k1_arr
++  if (any(co_str_k4_arr /= [ 4_'abc  ', 4_'EFG  ', 4_'klm  ', 4_'NOP  '])) call abort()
++
++  co_str_k1_arr(:)[1] = str_k4_arr
++  if (any(co_str_k1_arr /= ['abc  ', 'EFG  ', 'klm  ', 'NOP  '])) call abort()
++
++end program send_convert_char_array
++
++! vim:ts=2:sts=2:sw=2:
+Index: gcc/testsuite/gfortran.dg/alloc_comp_basics_1.f90
+===================================================================
+--- a/src/gcc/testsuite/gfortran.dg/alloc_comp_basics_1.f90	(.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/gfortran.dg/alloc_comp_basics_1.f90	(.../branches/gcc-7-branch)
+@@ -141,4 +141,4 @@
+     end subroutine check_alloc2
+ 
+ end program alloc
+-! { dg-final { scan-tree-dump-times "builtin_free" 18 "original" } }
++! { dg-final { scan-tree-dump-times "builtin_free" 21 "original" } }
 Index: gcc/testsuite/gfortran.dg/pr81723.f
 ===================================================================
 --- a/src/gcc/testsuite/gfortran.dg/pr81723.f	(.../tags/gcc_7_2_0_release)
@@ -13376,6 +13876,16 @@ Index: gcc/testsuite/gfortran.dg/typebound_proc_36.f90
 +
 +    if (ctr .ne. 1111) call abort
 +end program
+Index: gcc/testsuite/gfortran.dg/allocatable_scalar_9.f90
+===================================================================
+--- a/src/gcc/testsuite/gfortran.dg/allocatable_scalar_9.f90	(.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/gfortran.dg/allocatable_scalar_9.f90	(.../branches/gcc-7-branch)
+@@ -52,4 +52,4 @@
+ end block
+ end
+ 
+-! { dg-final { scan-tree-dump-times "__builtin_free" 32 "original" } }
++! { dg-final { scan-tree-dump-times "__builtin_free" 54 "original" } }
 Index: gcc/testsuite/gfortran.dg/execute_command_line_3.f90
 ===================================================================
 --- a/src/gcc/testsuite/gfortran.dg/execute_command_line_3.f90	(.../tags/gcc_7_2_0_release)
@@ -13432,6 +13942,18 @@ Index: gcc/testsuite/gfortran.dg/associate_27.f90
 + end associate
 +
 +end program p
+Index: gcc/testsuite/gfortran.dg/move_alloc_15.f90
+===================================================================
+--- a/src/gcc/testsuite/gfortran.dg/move_alloc_15.f90	(.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/gfortran.dg/move_alloc_15.f90	(.../branches/gcc-7-branch)
+@@ -84,5 +84,5 @@
+     end do
+   end subroutine
+ end program name
+-! { dg-final { scan-tree-dump-times "__builtin_malloc" 11 "original" } }
+-! { dg-final { scan-tree-dump-times "__builtin_free" 11 "original" } }
++! { dg-final { scan-tree-dump-times "__builtin_malloc" 14 "original" } }
++! { dg-final { scan-tree-dump-times "__builtin_free" 14 "original" } }
 Index: gcc/testsuite/gfortran.dg/warn_target_lifetime_4.f90
 ===================================================================
 --- a/src/gcc/testsuite/gfortran.dg/warn_target_lifetime_4.f90	(.../tags/gcc_7_2_0_release)
@@ -14830,7 +15352,33 @@ Index: gcc/testsuite/ChangeLog
 ===================================================================
 --- a/src/gcc/testsuite/ChangeLog	(.../tags/gcc_7_2_0_release)
 +++ b/src/gcc/testsuite/ChangeLog	(.../branches/gcc-7-branch)
-@@ -1,3 +1,630 @@
+@@ -1,3 +1,656 @@
++2017-11-06  Paul Thomas  <pault at gcc.gnu.org>
++
++	Backported from trunk
++	PR fortran/78641
++	* gfortran.dg/class_66.f90: New test.
++
++2017-11-06  Paul Thomas  <pault at gcc.gnu.org>
++
++	Backported from trunk
++	PR fortran/69739
++	* gfortran.dg/pr69739.f90: New test.
++
++2017-11-04  Steven G. Kargl  <kargl at gcc.gnu.org>
++
++	PR fortran/82796
++	* gfortran.dg/equiv_pure.f90: New test.
++
++2017-11-04  Andre Vehreschild  <vehre at gcc.gnu.org>
++
++	* gfortran.dg/coarray/send_char_array_1.f90: New test.
++
++2017-11-03  Paul Thomas  <pault at gcc.gnu.org>
++
++	PR fortran/81735
++	* gfortran.dg/pr81735.f90: New test.
++
 +2017-11-01  Tamar Christina  <tamar.christina at arm.com>
 +
 +	Backported from trunk
@@ -15461,7 +16009,7 @@ Index: gcc/testsuite/ChangeLog
  2017-08-14  Release Manager
  
  	* GCC 7.2.0 released.
-@@ -150,7 +777,7 @@
+@@ -150,7 +803,7 @@
  	* gfortran.dg/pr81175.f: New testcase.
  
  	2017-06-21  Marc Glisse  <marc.glisse at inria.fr>
@@ -15470,7 +16018,7 @@ Index: gcc/testsuite/ChangeLog
   	* gcc.dg/tree-ssa/addadd.c: Un-XFAIL.
   	* gcc.dg/tree-ssa/addadd-2.c: New file.
  
-@@ -358,7 +985,7 @@
+@@ -358,7 +1011,7 @@
  	* c-c++-common/ubsan/sanitize-recover-7.c (dg-options): Add -w.
  
  2017-06-24  Marek Polacek  <polacek at redhat.com>
@@ -15479,7 +16027,7 @@ Index: gcc/testsuite/ChangeLog
  	Backport from mainline
  	2017-05-04  Marek Polacek  <polacek at redhat.com>
  
-@@ -2273,7 +2900,7 @@
+@@ -2273,7 +2926,7 @@
  
  	PR fortran/80156
  	PR fortran/79382
@@ -15488,7 +16036,7 @@ Index: gcc/testsuite/ChangeLog
  	testcase for PR80156. Add a main programme that tests that
  	the typebound generic is accessible.
  
-@@ -2609,13 +3236,13 @@
+@@ -2609,13 +3262,13 @@
  2017-03-18  Paul Thomas  <pault at gcc.gnu.org>
  
  	PR fortran/79676
@@ -15505,6 +16053,18 @@ Index: gcc/testsuite/ChangeLog
  
  2017-03-17  Pat Haugen  <pthaugen at us.ibm.com>
  
+@@ -3474,6 +4127,11 @@
+ 	PR lto/79587
+ 	* gcc.dg/tree-prof/pr79587.c: New test.
+ 
++2017-02-22  Bill Schmidt  <wschmidt at linux.vnet.ibm.com>
++
++	PR tree-optimization/68644
++	* gcc.dg/tree-ssa/ivopts-lt-2.c: Skip for powerpc*-*-*.
++
+ 2017-02-21  Marek Polacek  <polacek at redhat.com>
+ 
+ 	PR c++/79535
 Index: gcc/testsuite/g++.dg/opt/pr82159-2.C
 ===================================================================
 --- a/src/gcc/testsuite/g++.dg/opt/pr82159-2.C	(.../tags/gcc_7_2_0_release)
@@ -18834,7 +19394,18 @@ Index: gcc/fortran/trans-expr.c
 ===================================================================
 --- a/src/gcc/fortran/trans-expr.c	(.../tags/gcc_7_2_0_release)
 +++ b/src/gcc/fortran/trans-expr.c	(.../branches/gcc-7-branch)
-@@ -5173,10 +5173,39 @@
+@@ -4178,9 +4178,7 @@
+       if (arg2 && arg2->expr_type == EXPR_CONSTANT)
+ 	d = mpz_get_si (arg2->value.integer) - 1;
+       else
+-	/* TODO: If the need arises, this could produce an array of
+-	   ubound/lbounds.  */
+-	gcc_unreachable ();
++	return false;
+ 
+       if (expr->value.function.isym->id == GFC_ISYM_LBOUND)
+ 	{
+@@ -5173,10 +5171,39 @@
  			}
  		      else
  			{
@@ -18878,7 +19449,7 @@ Index: gcc/fortran/trans-expr.c
  			  parmse.expr = gfc_build_addr_expr (NULL_TREE, var);
  			}
  		    }
-@@ -8051,7 +8080,7 @@
+@@ -8051,7 +8078,7 @@
      {
        /* Get the vptr from the rhs expression only, when it is variable.
  	 Functions are expected to be assigned to a temporary beforehand.  */
@@ -18887,7 +19458,7 @@ Index: gcc/fortran/trans-expr.c
  	  ? gfc_find_and_cut_at_last_class_ref (re)
  	  : NULL;
        if (vptr_expr != NULL && vptr_expr->ts.type == BT_CLASS)
-@@ -8205,6 +8234,39 @@
+@@ -8205,6 +8232,39 @@
  }
  
  
@@ -18927,7 +19498,7 @@ Index: gcc/fortran/trans-expr.c
  tree
  gfc_trans_pointer_assign (gfc_code * code)
  {
-@@ -8223,6 +8285,7 @@
+@@ -8223,6 +8283,7 @@
    tree desc;
    tree tmp;
    tree decl;
@@ -18935,7 +19506,7 @@ Index: gcc/fortran/trans-expr.c
    bool scalar, non_proc_pointer_assign;
    gfc_ss *ss;
  
-@@ -8256,7 +8319,10 @@
+@@ -8256,7 +8317,10 @@
        gfc_conv_expr (&lse, expr1);
        gfc_init_se (&rse, NULL);
        rse.want_pointer = 1;
@@ -18947,7 +19518,7 @@ Index: gcc/fortran/trans-expr.c
  
        if (non_proc_pointer_assign && expr1->ts.type == BT_CLASS)
  	{
-@@ -8268,12 +8334,12 @@
+@@ -8268,12 +8332,12 @@
        if (expr1->symtree->n.sym->attr.proc_pointer
  	  && expr1->symtree->n.sym->attr.dummy)
  	lse.expr = build_fold_indirect_ref_loc (input_location,
@@ -18962,7 +19533,7 @@ Index: gcc/fortran/trans-expr.c
  
        gfc_add_block_to_block (&block, &lse.pre);
        gfc_add_block_to_block (&block, &rse.pre);
-@@ -8319,7 +8385,6 @@
+@@ -8319,7 +8383,6 @@
      {
        gfc_ref* remap;
        bool rank_remap;
@@ -18970,7 +19541,7 @@ Index: gcc/fortran/trans-expr.c
        tree strlen_lhs;
        tree strlen_rhs = NULL_TREE;
  
-@@ -8354,26 +8419,8 @@
+@@ -8354,26 +8417,8 @@
  	  rse.byref_noassign = 1;
  
  	  if (expr2->expr_type == EXPR_FUNCTION && expr2->ts.type == BT_CLASS)
@@ -18999,6 +19570,48 @@ Index: gcc/fortran/trans-expr.c
  	  else if (expr2->expr_type == EXPR_FUNCTION)
  	    {
  	      tree bound[GFC_MAX_DIMENSIONS];
+@@ -10019,12 +10064,16 @@
+      NOTE: This relies on having the exact dependence of the length type
+      parameter available to the caller; gfortran saves it in the .mod files.
+      NOTE ALSO: The concatenation operation generates a temporary pointer,
+-     whose allocation must go to the innermost loop.  */
++     whose allocation must go to the innermost loop.
++     NOTE ALSO (2): A character conversion may generate a temporary, too.  */
+   if (flag_realloc_lhs
+       && expr2->ts.type == BT_CHARACTER && expr1->ts.deferred
+       && !(lss != gfc_ss_terminator
+-	   && expr2->expr_type == EXPR_OP
+-	   && expr2->value.op.op == INTRINSIC_CONCAT))
++	   && ((expr2->expr_type == EXPR_OP
++		&& expr2->value.op.op == INTRINSIC_CONCAT)
++	       || (expr2->expr_type == EXPR_FUNCTION
++		   && expr2->value.function.isym != NULL
++		   && expr2->value.function.isym->id == GFC_ISYM_CONVERSION))))
+     gfc_add_block_to_block (&block, &rse.pre);
+ 
+   /* Nullify the allocatable components corresponding to those of the lhs
+Index: gcc/fortran/trans-array.c
+===================================================================
+--- a/src/gcc/fortran/trans-array.c	(.../tags/gcc_7_2_0_release)
++++ b/src/gcc/fortran/trans-array.c	(.../branches/gcc-7-branch)
+@@ -1441,6 +1441,17 @@
+ 	    }
+ 	}
+     }
++  else if (GFC_CLASS_TYPE_P (TREE_TYPE (se->expr))
++	   && !GFC_CLASS_TYPE_P (gfc_get_element_type (TREE_TYPE (desc))))
++    {
++      /* Assignment of a CLASS array constructor to a derived type array.  */
++      if (expr->expr_type == EXPR_FUNCTION)
++	se->expr = gfc_evaluate_now (se->expr, pblock);
++      se->expr = gfc_class_data_get (se->expr);
++      se->expr = build_fold_indirect_ref_loc (input_location, se->expr);
++      se->expr = fold_convert (TREE_TYPE (tmp), se->expr);
++      gfc_add_modify (&se->pre, tmp, se->expr);
++    }
+   else
+     {
+       /* TODO: Should the frontend already have done this conversion?  */
 Index: gcc/fortran/decl.c
 ===================================================================
 --- a/src/gcc/fortran/decl.c	(.../tags/gcc_7_2_0_release)
@@ -19037,7 +19650,46 @@ Index: gcc/fortran/ChangeLog
 ===================================================================
 --- a/src/gcc/fortran/ChangeLog	(.../tags/gcc_7_2_0_release)
 +++ b/src/gcc/fortran/ChangeLog	(.../branches/gcc-7-branch)
-@@ -1,3 +1,114 @@
+@@ -1,3 +1,153 @@
++2017-11-06  Paul Thomas  <pault at gcc.gnu.org>
++
++	Backported from trunk
++	PR fortran/78641
++	* resolve.c (resolve_ordinary_assign): Do not add the _data
++	component for class valued array constructors being assigned
++	to derived type arrays.
++	* trans-array.c (gfc_trans_array_ctor_element): Take the _data
++	of class valued elements for assignment to derived type arrays.
++
++2017-11-06  Paul Thomas  <pault at gcc.gnu.org>
++
++	Backported from trunk
++	PR fortran/69739
++	* trans-expr.c (gfc_map_intrinsic_function): Return false for
++	bounds without the DIM argument instead of ICEing.
++
++2017-11-04  Steven G. Kargl  <kargl at gcc.gnu.org>
++
++	PR fortran/82796
++	* resolve.c (resolve_equivalence): An entity in a common block within
++ 	a module cannot appear in an equivalence statement if the entity is
++	with a pure procedure.
++
++2017-11-04  Andre Vehreschild  <vehre at gcc.gnu.org>
++
++	* trans-expr.c (gfc_trans_assignment_1): Character kind conversion may
++	create a loop variant temporary, too.
++	* trans-intrinsic.c (conv_caf_send): Treat char arrays as arrays and
++	not as scalars.
++	* trans.c (get_array_span): Take the character kind into account when
++	doing pointer arithmetic.
++
++2017-11-03  Paul Thomas  <pault at gcc.gnu.org>
++
++	PR fortran/81735
++	* trans-decl.c (gfc_trans_deferred_vars): Correct case where
++	'tmp' can be used unititialized.
++
 +2017-11-01  Paul Thomas  <pault at gcc.gnu.org>
 +
 +	Backported from trunk
@@ -19195,6 +19847,26 @@ Index: gcc/fortran/expr.c
        for (ref = expr->ref; ref; ref = ref->next)
  	{
  	  switch (ref->type)
+Index: gcc/fortran/trans.c
+===================================================================
+--- a/src/gcc/fortran/trans.c	(.../tags/gcc_7_2_0_release)
++++ b/src/gcc/fortran/trans.c	(.../branches/gcc-7-branch)
+@@ -342,7 +342,14 @@
+ 	  || TREE_CODE (decl) == FUNCTION_DECL
+ 	  || DECL_CONTEXT (TYPE_MAXVAL (TYPE_DOMAIN (type)))
+ 					== DECL_CONTEXT (decl)))
+-    span = TYPE_MAXVAL (TYPE_DOMAIN (type));
++    {
++      span = fold_convert (gfc_array_index_type,
++			   TYPE_MAX_VALUE (TYPE_DOMAIN (type)));
++      span = fold_build2 (MULT_EXPR, gfc_array_index_type,
++			  fold_convert (gfc_array_index_type,
++					TYPE_SIZE_UNIT (TREE_TYPE (type))),
++			  span);
++    }
+   else
+     span = NULL_TREE;
+ 
 Index: gcc/fortran/resolve.c
 ===================================================================
 --- a/src/gcc/fortran/resolve.c	(.../tags/gcc_7_2_0_release)
@@ -19223,7 +19895,17 @@ Index: gcc/fortran/resolve.c
    gcc_assert (sym->ts.type != BT_UNKNOWN);
  
    /* See if this is a valid association-to-variable.  */
-@@ -11005,11 +11017,8 @@
+@@ -10112,7 +10124,8 @@
+ 
+   /* Assign the 'data' of a class object to a derived type.  */
+   if (lhs->ts.type == BT_DERIVED
+-      && rhs->ts.type == BT_CLASS)
++      && rhs->ts.type == BT_CLASS
++      && rhs->expr_type != EXPR_ARRAY)
+     gfc_add_data_component (rhs);
+ 
+   bool caf_convert_to_send = flag_coarray == GFC_FCOARRAY_LIB
+@@ -11005,11 +11018,8 @@
  
  	    /* Assigning a class object always is a regular assign.  */
  	    if (code->expr2->ts.type == BT_CLASS
@@ -19236,7 +19918,7 @@ Index: gcc/fortran/resolve.c
  		&& !(gfc_expr_attr (code->expr1).proc_pointer
  		     && code->expr2->expr_type == EXPR_VARIABLE
  		     && code->expr2->symtree->n.sym->attr.flavor
-@@ -11824,6 +11833,7 @@
+@@ -11824,6 +11834,7 @@
    if (sym->ts.deferred
        && !(sym->attr.pointer
  	   || sym->attr.allocatable
@@ -19244,7 +19926,38 @@ Index: gcc/fortran/resolve.c
  	   || sym->attr.omp_udr_artificial_var))
      {
        gfc_error ("Entity %qs at %L has a deferred type parameter and "
-@@ -14231,7 +14241,23 @@
+@@ -13288,6 +13299,9 @@
+   if (c->attr.artificial)
+     return true;
+ 
++  if (sym->attr.vtype && sym->attr.use_assoc)
++    return true;
++
+   /* F2008, C442.  */
+   if ((!sym->attr.is_class || c != sym->components)
+       && c->attr.codimension
+@@ -13847,6 +13861,20 @@
+   if (!resolve_typebound_procedures (sym))
+     return false;
+ 
++  /* Generate module vtables subject to their accessibility and their not
++     being vtables or pdt templates. If this is not done class declarations
++     in external procedures wind up with their own version and so SELECT TYPE
++     fails because the vptrs do not have the same address.  */
++  if (gfc_option.allow_std & GFC_STD_F2003
++      && sym->ns->proc_name
++      && sym->ns->proc_name->attr.flavor == FL_MODULE
++      && sym->attr.access != ACCESS_PRIVATE
++      && !(sym->attr.use_assoc || sym->attr.vtype))
++    {
++      gfc_symbol *vtab = gfc_find_derived_vtab (sym);
++      gfc_set_sym_referenced (vtab);
++    }
++
+   return true;
+ }
+ 
+@@ -14231,7 +14259,23 @@
  
    if (as)
      {
@@ -19269,7 +19982,7 @@ Index: gcc/fortran/resolve.c
        if (((as->type == AS_ASSUMED_SIZE && !as->cp_was_assumed)
  	   || as->type == AS_ASSUMED_SHAPE)
  	  && !sym->attr.dummy && !sym->attr.select_type_temporary)
-@@ -14609,6 +14635,7 @@
+@@ -14609,6 +14653,7 @@
    if (class_attr.codimension
        && !(class_attr.allocatable || sym->attr.dummy || sym->attr.save
  	   || sym->attr.select_type_temporary
@@ -19277,7 +19990,7 @@ Index: gcc/fortran/resolve.c
  	   || (sym->ns->save_all && !sym->attr.automatic)
  	   || sym->ns->proc_name->attr.flavor == FL_MODULE
  	   || sym->ns->proc_name->attr.is_main_program
-@@ -14793,7 +14820,12 @@
+@@ -14793,7 +14838,12 @@
  
        if ((!a->save && !a->dummy && !a->pointer
  	   && !a->in_common && !a->use_assoc
@@ -19291,6 +20004,48 @@ Index: gcc/fortran/resolve.c
  	  || (a->dummy && a->intent == INTENT_OUT && !a->pointer))
  	apply_default_init (sym);
        else if (a->function && sym->result && a->access != ACCESS_PRIVATE
+@@ -15626,9 +15676,22 @@
+ 	  && sym->ns->proc_name->attr.pure
+ 	  && sym->attr.in_common)
+ 	{
+-	  gfc_error ("Common block member %qs at %L cannot be an EQUIVALENCE "
+-		     "object in the pure procedure %qs",
+-		     sym->name, &e->where, sym->ns->proc_name->name);
++	  /* Need to check for symbols that may have entered the pure
++	     procedure via a USE statement.  */
++	  bool saw_sym = false;
++	  if (sym->ns->use_stmts)
++	    {
++	      gfc_use_rename *r;
++	      for (r = sym->ns->use_stmts->rename; r; r = r->next)
++		if (strcmp(r->use_name, sym->name) == 0) saw_sym = true;
++	    }
++	  else
++	    saw_sym = true;
++
++	  if (saw_sym)
++	    gfc_error ("COMMON block member %qs at %L cannot be an "
++		       "EQUIVALENCE object in the pure procedure %qs",
++		       sym->name, &e->where, sym->ns->proc_name->name);
+ 	  break;
+ 	}
+ 
+Index: gcc/fortran/trans-decl.c
+===================================================================
+--- a/src/gcc/fortran/trans-decl.c	(.../tags/gcc_7_2_0_release)
++++ b/src/gcc/fortran/trans-decl.c	(.../branches/gcc-7-branch)
+@@ -4499,7 +4499,10 @@
+ 		    && sym->ts.u.cl->passed_length)
+ 		tmp = gfc_null_and_pass_deferred_len (sym, &init, &loc);
+ 	      else
+-		gfc_restore_backend_locus (&loc);
++		{
++		  gfc_restore_backend_locus (&loc);
++		  tmp = NULL_TREE;
++		}
+ 
+ 	      /* Deallocate when leaving the scope. Nullifying is not
+ 		 needed.  */
 Index: gcc/fortran/match.c
 ===================================================================
 --- a/src/gcc/fortran/match.c	(.../tags/gcc_7_2_0_release)
@@ -19498,6 +20253,38 @@ Index: gcc/fortran/primary.c
        old_loc = gfc_current_locus;
        if (gfc_match_member_sep (sym) == MATCH_YES
  	  && sym->ts.type == BT_UNKNOWN
+Index: gcc/fortran/trans-intrinsic.c
+===================================================================
+--- a/src/gcc/fortran/trans-intrinsic.c	(.../tags/gcc_7_2_0_release)
++++ b/src/gcc/fortran/trans-intrinsic.c	(.../branches/gcc-7-branch)
+@@ -1872,12 +1872,21 @@
+   gfc_init_se (&lhs_se, NULL);
+   if (lhs_expr->rank == 0)
+     {
+-      symbol_attribute attr;
+-      gfc_clear_attr (&attr);
+-      gfc_conv_expr (&lhs_se, lhs_expr);
+-      lhs_type = TREE_TYPE (lhs_se.expr);
+-      lhs_se.expr = gfc_conv_scalar_to_descriptor (&lhs_se, lhs_se.expr, attr);
+-      lhs_se.expr = gfc_build_addr_expr (NULL_TREE, lhs_se.expr);
++      if (lhs_expr->ts.type == BT_CHARACTER && lhs_expr->ts.deferred)
++	{
++	  lhs_se.expr = gfc_get_tree_for_caf_expr (lhs_expr);
++	  lhs_se.expr = gfc_build_addr_expr (NULL_TREE, lhs_se.expr);
++	}
++      else
++	{
++	  symbol_attribute attr;
++	  gfc_clear_attr (&attr);
++	  gfc_conv_expr (&lhs_se, lhs_expr);
++	  lhs_type = TREE_TYPE (lhs_se.expr);
++	  lhs_se.expr = gfc_conv_scalar_to_descriptor (&lhs_se, lhs_se.expr,
++						       attr);
++	  lhs_se.expr = gfc_build_addr_expr (NULL_TREE, lhs_se.expr);
++	}
+     }
+   else if ((lhs_caf_attr.alloc_comp || lhs_caf_attr.pointer_comp)
+ 	   && lhs_caf_attr.codimension)
 Index: gcc/langhooks.h
 ===================================================================
 --- a/src/gcc/langhooks.h	(.../tags/gcc_7_2_0_release)
@@ -19741,7 +20528,32 @@ Index: gcc/lra-constraints.c
 ===================================================================
 --- a/src/gcc/lra-constraints.c	(.../tags/gcc_7_2_0_release)
 +++ b/src/gcc/lra-constraints.c	(.../branches/gcc-7-branch)
-@@ -4284,7 +4284,13 @@
+@@ -4222,8 +4222,9 @@
+ 	      reg = SUBREG_REG (*loc);
+ 	      byte = SUBREG_BYTE (*loc);
+ 	      if (REG_P (reg)
+-		  /* Strict_low_part requires reload the register not
+-		     the sub-register.	*/
++		  /* Strict_low_part requires reloading the register and not
++		     just the subreg.  Likewise for a strict subreg no wider
++		     than a word for WORD_REGISTER_OPERATIONS targets.  */
+ 		  && (curr_static_id->operand[i].strict_low
+ 		      || (GET_MODE_SIZE (mode)
+ 			  <= GET_MODE_SIZE (GET_MODE (reg))
+@@ -4235,7 +4236,11 @@
+ 			  && (goal_alt[i] == NO_REGS
+ 			      || (simplify_subreg_regno
+ 				  (ira_class_hard_regs[goal_alt[i]][0],
+-				   GET_MODE (reg), byte, mode) >= 0)))))
++				   GET_MODE (reg), byte, mode) >= 0)))
++		      || (GET_MODE_PRECISION (mode)
++			  < GET_MODE_PRECISION (GET_MODE (reg))
++			  && GET_MODE_SIZE (GET_MODE (reg)) <= UNITS_PER_WORD
++			  && WORD_REGISTER_OPERATIONS)))
+ 		{
+ 		  /* An OP_INOUT is required when reloading a subreg of a
+ 		     mode wider than a word to ensure that data beyond the
+@@ -4284,7 +4289,13 @@
  	}
        else if (curr_static_id->operand[i].type == OP_IN
  	       && (curr_static_id->operand[goal_alt_matched[i][0]].type
@@ -19756,7 +20568,7 @@ Index: gcc/lra-constraints.c
  	{
  	  /* generate reloads for input and matched outputs.  */
  	  match_inputs[0] = i;
-@@ -4295,9 +4301,14 @@
+@@ -4295,9 +4306,14 @@
  			[goal_alt_number * n_operands + goal_alt_matched[i][0]]
  			.earlyclobber);
  	}
@@ -322163,6 +322975,36 @@ Index: gcc/combine.c
      inner = XEXP (inner, 0);
  
    inner_mode = GET_MODE (inner);
+@@ -14218,6 +14230,17 @@
+ 		  && CALL_P (from_insn)
+ 		  && find_reg_fusage (from_insn, USE, XEXP (note, 0)))
+ 		place = from_insn;
++	      else if (i2 && reg_set_p (XEXP (note, 0), PATTERN (i2)))
++		{
++		  /* If the new I2 sets the same register that is marked
++		     dead in the note, we do not in general know where to
++		     put the note.  One important case we _can_ handle is
++		     when the note comes from I3.  */
++		  if (from_insn == i3)
++		    place = i3;
++		  else
++		    break;
++		}
+ 	      else if (reg_referenced_p (XEXP (note, 0), PATTERN (i3)))
+ 		place = i3;
+ 	      else if (i2 != 0 && next_nonnote_nondebug_insn (i2) == i3
+@@ -14231,11 +14254,6 @@
+ 		       || rtx_equal_p (XEXP (note, 0), elim_i0))
+ 		break;
+ 	      tem_insn = i3;
+-	      /* If the new I2 sets the same register that is marked dead
+-		 in the note, we do not know where to put the note.
+-		 Give up.  */
+-	      if (i2 != 0 && reg_set_p (XEXP (note, 0), PATTERN (i2)))
+-		break;
+ 	    }
+ 
+ 	  if (place == 0)
 Index: gcc/bb-reorder.c
 ===================================================================
 --- a/src/gcc/bb-reorder.c	(.../tags/gcc_7_2_0_release)
@@ -323135,7 +323977,69 @@ Index: gcc/config/aarch64/aarch64.c
 ===================================================================
 --- a/src/gcc/config/aarch64/aarch64.c	(.../tags/gcc_7_2_0_release)
 +++ b/src/gcc/config/aarch64/aarch64.c	(.../branches/gcc-7-branch)
-@@ -11509,19 +11509,9 @@
+@@ -2764,12 +2764,13 @@
+ static bool
+ aarch64_frame_pointer_required (void)
+ {
+-  /* In aarch64_override_options_after_change
+-     flag_omit_leaf_frame_pointer turns off the frame pointer by
+-     default.  Turn it back on now if we've not got a leaf
+-     function.  */
+-  if (flag_omit_leaf_frame_pointer
+-      && (!crtl->is_leaf || df_regs_ever_live_p (LR_REGNUM)))
++  /* Use the frame pointer if enabled and it is not a leaf function, unless
++     leaf frame pointer omission is disabled.  If the frame pointer is enabled,
++     force the frame pointer in leaf functions which use LR.  */
++  if (flag_omit_frame_pointer == 2
++      && !(flag_omit_leaf_frame_pointer
++	   && crtl->is_leaf
++	   && !df_regs_ever_live_p (LR_REGNUM)))
+     return true;
+ 
+   /* Force a frame pointer for EH returns so the return address is at FP+8.  */
+@@ -5623,6 +5624,7 @@
+ 	 LR in the function, then we'll want a frame pointer after all, so
+ 	 prevent this elimination to ensure a frame pointer is used.  */
+       if (to == STACK_POINTER_REGNUM
++	  && flag_omit_frame_pointer == 2
+ 	  && flag_omit_leaf_frame_pointer
+ 	  && df_regs_ever_live_p (LR_REGNUM))
+ 	return false;
+@@ -8573,24 +8575,16 @@
+ static void
+ aarch64_override_options_after_change_1 (struct gcc_options *opts)
+ {
+-  /* The logic here is that if we are disabling all frame pointer generation
+-     then we do not need to disable leaf frame pointer generation as a
+-     separate operation.  But if we are *only* disabling leaf frame pointer
+-     generation then we set flag_omit_frame_pointer to true, but in
+-     aarch64_frame_pointer_required we return false only for leaf functions.
++  /* PR 70044: We have to be careful about being called multiple times for the
++     same function.  This means all changes should be repeatable.  */
+ 
+-     PR 70044: We have to be careful about being called multiple times for the
+-     same function.  Once we have decided to set flag_omit_frame_pointer just
+-     so that we can omit leaf frame pointers, we must then not interpret a
+-     second call as meaning that all frame pointer generation should be
+-     omitted.  We do this by setting flag_omit_frame_pointer to a special,
+-     non-zero value.  */
+-  if (opts->x_flag_omit_frame_pointer == 2)
+-    opts->x_flag_omit_frame_pointer = 0;
+-
+-  if (opts->x_flag_omit_frame_pointer)
+-    opts->x_flag_omit_leaf_frame_pointer = false;
+-  else if (opts->x_flag_omit_leaf_frame_pointer)
++  /* If the frame pointer is enabled, set it to a special value that behaves
++     similar to frame pointer omission.  If we don't do this all leaf functions
++     will get a frame pointer even if flag_omit_leaf_frame_pointer is set.
++     If flag_omit_frame_pointer has this special value, we must force the
++     frame pointer if not in a leaf function.  We also need to force it in a
++     leaf function if flag_omit_frame_pointer is not set or if LR is used.  */
++  if (opts->x_flag_omit_frame_pointer == 0)
+     opts->x_flag_omit_frame_pointer = 2;
+ 
+   /* If not optimizing for size, set the default
+@@ -11509,19 +11503,9 @@
        if (optab_handler (movmisalign_optab, mode) == CODE_FOR_nothing)
          return false;
  

-- 
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