diff -Nrcpad gcc-13-20251002/LAST_UPDATED gcc-13-20251009/LAST_UPDATED
*** gcc-13-20251002/LAST_UPDATED	Thu Oct  2 22:35:12 2025
--- gcc-13-20251009/LAST_UPDATED	Thu Oct  9 22:34:01 2025
***************
*** 1 ****
! Obtained from git: releases/gcc-13 revision 279cffffbfd614758716ee8f0357468648a12115
--- 1 ----
! Obtained from git: releases/gcc-13 revision f875cd8bfea59ba23f3958ccff914126a0cae0d0
diff -Nrcpad gcc-13-20251002/MD5SUMS gcc-13-20251009/MD5SUMS
*** gcc-13-20251002/MD5SUMS	Thu Oct  2 22:35:23 2025
--- gcc-13-20251009/MD5SUMS	Thu Oct  9 22:34:08 2025
***************
*** 1,5 ****
  # This file contains the MD5 checksums of the files in the
! # gcc-13-20251002.tar.xz tarball.
  #
  # Besides verifying that all files in the tarball were correctly expanded,
  # it also can be used to determine if any files have changed since the
--- 1,5 ----
  # This file contains the MD5 checksums of the files in the
! # gcc-13-20251009.tar.xz tarball.
  #
  # Besides verifying that all files in the tarball were correctly expanded,
  # it also can be used to determine if any files have changed since the
*************** d32239bcb673463ab874e80d47fae504  COPYIN
*** 21,27 ****
  fd4ecdf5d672efe2b0e409aca9cf9446  ChangeLog.jit
  09538b708302f1735f6fa05b622ecf5e  ChangeLog.tree-ssa
  24ab760126489e69436a43185dc3d202  INSTALL/README
! 232e78a93e8e6551835dfe92d1564b10  LAST_UPDATED
  81b3330d422f3ce1ef8b720dfae35068  MAINTAINERS
  2b61ddbd876fa839639a7ca551773426  Makefile.def
  5d2d6a74f897f8158d37f5f2ec6877ce  Makefile.in
--- 21,27 ----
  fd4ecdf5d672efe2b0e409aca9cf9446  ChangeLog.jit
  09538b708302f1735f6fa05b622ecf5e  ChangeLog.tree-ssa
  24ab760126489e69436a43185dc3d202  INSTALL/README
! f024669012d790c29e9e74ff74542605  LAST_UPDATED
  81b3330d422f3ce1ef8b720dfae35068  MAINTAINERS
  2b61ddbd876fa839639a7ca551773426  Makefile.def
  5d2d6a74f897f8158d37f5f2ec6877ce  Makefile.in
*************** a22e70b3f29292d0e628450f4bb11e62  fixinc
*** 475,481 ****
  a916467b91076e631dd8edb7424769c7  gcc/COPYING.LIB
  d32239bcb673463ab874e80d47fae504  gcc/COPYING3
  6a6a8e020838b23406c81b19c1d46df6  gcc/COPYING3.LIB
! c3d73ac452f98b83b276c2273825994b  gcc/ChangeLog
  a3b63c675afa7a655cc2bfa8a907af79  gcc/ChangeLog-1997
  d9a88529352a010253c2e8fb1ed6023b  gcc/ChangeLog-1998
  240f08f81cb4699e8b49347db38233db  gcc/ChangeLog-1999
--- 475,481 ----
  a916467b91076e631dd8edb7424769c7  gcc/COPYING.LIB
  d32239bcb673463ab874e80d47fae504  gcc/COPYING3
  6a6a8e020838b23406c81b19c1d46df6  gcc/COPYING3.LIB
! acfc1fb32262566f066aff66691d6401  gcc/ChangeLog
  a3b63c675afa7a655cc2bfa8a907af79  gcc/ChangeLog-1997
  d9a88529352a010253c2e8fb1ed6023b  gcc/ChangeLog-1998
  240f08f81cb4699e8b49347db38233db  gcc/ChangeLog-1999
*************** fb3fadb88e1d2b3b640cfaaa5ff11780  gcc/Ch
*** 510,516 ****
  3eb07e0b2e542409bf73d359f7f65609  gcc/ChangeLog.ptr
  e13638e26743ba41e6011b76cc00d9a9  gcc/ChangeLog.tree-ssa
  739ab47f6425bcea1d05e4fc0542de54  gcc/ChangeLog.tuples
! b366e9d7c37faca2364ee9051fecdb1b  gcc/DATESTAMP
  d41d8cd98f00b204e9800998ecf8427e  gcc/DEV-PHASE
  eb92e1ff5e982ca07e173e0eb286d243  gcc/FSFChangeLog
  30e1e33411566388b3164558482dc5e6  gcc/FSFChangeLog.10
--- 510,516 ----
  3eb07e0b2e542409bf73d359f7f65609  gcc/ChangeLog.ptr
  e13638e26743ba41e6011b76cc00d9a9  gcc/ChangeLog.tree-ssa
  739ab47f6425bcea1d05e4fc0542de54  gcc/ChangeLog.tuples
! 3e738d9527db5282895d85aa1a803719  gcc/DATESTAMP
  d41d8cd98f00b204e9800998ecf8427e  gcc/DEV-PHASE
  eb92e1ff5e982ca07e173e0eb286d243  gcc/FSFChangeLog
  30e1e33411566388b3164558482dc5e6  gcc/FSFChangeLog.10
*************** c2dbf831f4bbc53553765214d1b2d674  gcc/fl
*** 5576,5582 ****
  46538296abcbd26df93f276f5974ec0f  gcc/fold-const-call.h
  f32e31e2e5d7d430555b0a476972ca3a  gcc/fold-const.cc
  9dd2c87502c864095a8b942bea07b5f3  gcc/fold-const.h
! 0c6771b89b2cb598d39fe199e783fd9a  gcc/fortran/ChangeLog
  3330102ad3a0217cba963be6b5eefd58  gcc/fortran/ChangeLog-2002
  d000ab985b1eeb1ad5749f98b8fef99f  gcc/fortran/ChangeLog-2003
  bf42f94f0c51dcc7d8051cc7fda1efdc  gcc/fortran/ChangeLog-2004
--- 5576,5582 ----
  46538296abcbd26df93f276f5974ec0f  gcc/fold-const-call.h
  f32e31e2e5d7d430555b0a476972ca3a  gcc/fold-const.cc
  9dd2c87502c864095a8b942bea07b5f3  gcc/fold-const.h
! 925ecb2465334ee94caa52d8b639f4b2  gcc/fortran/ChangeLog
  3330102ad3a0217cba963be6b5eefd58  gcc/fortran/ChangeLog-2002
  d000ab985b1eeb1ad5749f98b8fef99f  gcc/fortran/ChangeLog-2003
  bf42f94f0c51dcc7d8051cc7fda1efdc  gcc/fortran/ChangeLog-2004
*************** b16988fb11ef93959450cfdd9eaa8825  gcc/fo
*** 5666,5672 ****
  2825c959ade33ef2a6492d640b05ef8c  gcc/fortran/trans-const.h
  c15bfe2308615f6c0395efd6cdf7a3ae  gcc/fortran/trans-decl.cc
  db3105c2b544e19c5f87f1fc6165b7c0  gcc/fortran/trans-expr.cc
! 270fb3d641aa95f5ab3435bcf555d167  gcc/fortran/trans-intrinsic.cc
  c2777cd0e39ba69462f4cf01549e1001  gcc/fortran/trans-io.cc
  4100e048c21085f4f2f9bdb70f4e29a2  gcc/fortran/trans-openmp.cc
  8c36caba9ba82554a7f97e56b2a48d63  gcc/fortran/trans-stmt.cc
--- 5666,5672 ----
  2825c959ade33ef2a6492d640b05ef8c  gcc/fortran/trans-const.h
  c15bfe2308615f6c0395efd6cdf7a3ae  gcc/fortran/trans-decl.cc
  db3105c2b544e19c5f87f1fc6165b7c0  gcc/fortran/trans-expr.cc
! 7a6a0f4f555cbc9df7d147a017fc7444  gcc/fortran/trans-intrinsic.cc
  c2777cd0e39ba69462f4cf01549e1001  gcc/fortran/trans-io.cc
  4100e048c21085f4f2f9bdb70f4e29a2  gcc/fortran/trans-openmp.cc
  8c36caba9ba82554a7f97e56b2a48d63  gcc/fortran/trans-stmt.cc
*************** e787a3b9712d1eb24c32dd0cc731ccbd  gcc/po
*** 7204,7210 ****
  826e8613602ff66b4826777cca1f0f8c  gcc/poly-int-types.h
  904c1ca12d0557980609eab0e8c559a7  gcc/poly-int.h
  8d639c83a53e2fc94a92dd31a295728e  gcc/postreload-gcse.cc
! aa38a16aae72c73780bfc35f1192be5e  gcc/postreload.cc
  e391674d14a8a9d1efc43643c37b2f21  gcc/predict.cc
  a4947e8f0ddcbc7eb9df2fa43790fec7  gcc/predict.def
  005dc519df06271b4a76719be9cc89ed  gcc/predict.h
--- 7204,7210 ----
  826e8613602ff66b4826777cca1f0f8c  gcc/poly-int-types.h
  904c1ca12d0557980609eab0e8c559a7  gcc/poly-int.h
  8d639c83a53e2fc94a92dd31a295728e  gcc/postreload-gcse.cc
! 58d44f3850805a0ffb22539255a1803b  gcc/postreload.cc
  e391674d14a8a9d1efc43643c37b2f21  gcc/predict.cc
  a4947e8f0ddcbc7eb9df2fa43790fec7  gcc/predict.def
  005dc519df06271b4a76719be9cc89ed  gcc/predict.h
*************** b829ed0032c899e107be2db349c913f3  gcc/ta
*** 7637,7643 ****
  811da275a2b9d3186a6decf96c01b0ed  gcc/targhooks.cc
  edb193a32070c4a7626fb75382def9b9  gcc/targhooks.h
  f39fcaa8197187283ccfed40107b426d  gcc/testsuite/.gitattributes
! 5299bf6a5ae5b9a8d330eac318fd7ff8  gcc/testsuite/ChangeLog
  862f04afbd87da2cc6bc432c3f28430f  gcc/testsuite/ChangeLog-1993-2007
  029a5d8dacd25eb5d4711452ac448e5b  gcc/testsuite/ChangeLog-2008
  13ac28c41d51b66b4ec40dba6bd50f39  gcc/testsuite/ChangeLog-2009
--- 7637,7643 ----
  811da275a2b9d3186a6decf96c01b0ed  gcc/targhooks.cc
  edb193a32070c4a7626fb75382def9b9  gcc/targhooks.h
  f39fcaa8197187283ccfed40107b426d  gcc/testsuite/.gitattributes
! e1ef4c4cb991a221f8483766336c5637  gcc/testsuite/ChangeLog
  862f04afbd87da2cc6bc432c3f28430f  gcc/testsuite/ChangeLog-1993-2007
  029a5d8dacd25eb5d4711452ac448e5b  gcc/testsuite/ChangeLog-2008
  13ac28c41d51b66b4ec40dba6bd50f39  gcc/testsuite/ChangeLog-2009
*************** e854bc80f793329b6c96d31e3f80a012  gcc/te
*** 36334,36339 ****
--- 36334,36340 ----
  12785ab6e086a50cd8ab9f5bdb9a9bc5  gcc/testsuite/gcc.c-torture/execute/pending-4.c
  5ad23d6cafc55e78896b90e3669a14b8  gcc/testsuite/gcc.c-torture/execute/postmod-1.c
  64b80dcfbe526f0e5993e4b739431227  gcc/testsuite/gcc.c-torture/execute/pr100453.c
+ 7eb7ffbe788ba5ef0ae0a135815b758b  gcc/testsuite/gcc.c-torture/execute/pr101188.c
  859a8616bb39c775a0c9e44482a3e048  gcc/testsuite/gcc.c-torture/execute/pr101335.c
  a2175770e21b82966738b5577f0fae06  gcc/testsuite/gcc.c-torture/execute/pr102134.c
  6f562291c92a478431678da451525a90  gcc/testsuite/gcc.c-torture/execute/pr103052.c
*************** ad625f0340741a09e4be8d42e070139e  gcc/te
*** 91113,91118 ****
--- 91114,91120 ----
  7f1199fe5fa90085dcbb4f81cbcf7062  gcc/testsuite/gfortran.dg/transfer_class_2.f90
  4003da30901edcfc6adf19924dc746a2  gcc/testsuite/gfortran.dg/transfer_class_3.f90
  d9a1040ed4fe93e5d91936d8b26af4cc  gcc/testsuite/gfortran.dg/transfer_class_4.f90
+ d265a0bb0e3067107f69caac520518ea  gcc/testsuite/gfortran.dg/transfer_class_5.f90
  dc67674921059cc6c14a48ba9f6e8515  gcc/testsuite/gfortran.dg/transfer_hollerith_1.f90
  adc172acf631bf550ac06d92fba37d99  gcc/testsuite/gfortran.dg/transfer_intrinsic_1.f90
  e26ab1b7e21f778b1135b8600958bcd1  gcc/testsuite/gfortran.dg/transfer_intrinsic_2.f90
diff -Nrcpad gcc-13-20251002/gcc/ChangeLog gcc-13-20251009/gcc/ChangeLog
*** gcc-13-20251002/gcc/ChangeLog	Thu Oct  2 22:32:57 2025
--- gcc-13-20251009/gcc/ChangeLog	Thu Oct  9 22:32:27 2025
***************
*** 1,3 ****
--- 1,13 ----
+ 2025-10-03  Jeff Law  <jlaw@ventanamicro.com>
+ 
+ 	Backported from master:
+ 	2023-06-12  Jeff Law  <jlaw@ventanamicro.com>
+ 
+ 	PR rtl-optimization/101188
+ 	* postreload.cc (reload_cse_move2add_invalidate): New function,
+ 	extracted from...
+ 	(reload_cse_move2add): Call reload_cse_move2add_invalidate.
+ 
  2025-09-18  hongtao.liu  <hongtao.liu@intel.com>
  
  	Backported from master:
diff -Nrcpad gcc-13-20251002/gcc/DATESTAMP gcc-13-20251009/gcc/DATESTAMP
*** gcc-13-20251002/gcc/DATESTAMP	Thu Oct  2 22:32:57 2025
--- gcc-13-20251009/gcc/DATESTAMP	Thu Oct  9 22:32:27 2025
***************
*** 1 ****
! 20251002
--- 1 ----
! 20251009
diff -Nrcpad gcc-13-20251002/gcc/fortran/ChangeLog gcc-13-20251009/gcc/fortran/ChangeLog
*** gcc-13-20251002/gcc/fortran/ChangeLog	Thu Oct  2 22:32:59 2025
--- gcc-13-20251009/gcc/fortran/ChangeLog	Thu Oct  9 22:32:30 2025
***************
*** 1,3 ****
--- 1,13 ----
+ 2025-10-05  Harald Anlauf  <anlauf@gmx.de>
+ 
+ 	Backported from master:
+ 	2025-09-03  Harald Anlauf  <anlauf@gmx.de>
+ 
+ 	PR fortran/121263
+ 	* trans-intrinsic.cc (gfc_conv_intrinsic_transfer): For an
+ 	unlimited polymorphic SOURCE to TRANSFER use saved descriptor
+ 	if possible.
+ 
  2025-06-05  Release Manager
  
  	* GCC 13.4.0 released.
diff -Nrcpad gcc-13-20251002/gcc/fortran/trans-intrinsic.cc gcc-13-20251009/gcc/fortran/trans-intrinsic.cc
*** gcc-13-20251002/gcc/fortran/trans-intrinsic.cc	Thu Oct  2 22:32:59 2025
--- gcc-13-20251009/gcc/fortran/trans-intrinsic.cc	Thu Oct  9 22:32:30 2025
*************** gfc_conv_intrinsic_transfer (gfc_se * se
*** 8513,8519 ****
  				       argse.string_length);
        else if (arg->expr->ts.type == BT_CLASS)
  	{
! 	  class_ref = TREE_OPERAND (argse.expr, 0);
  	  tmp = gfc_class_vtab_size_get (class_ref);
  	  if (UNLIMITED_POLY (arg->expr))
  	    tmp = gfc_resize_class_size_with_len (&argse.pre, class_ref, tmp);
--- 8513,8524 ----
  				       argse.string_length);
        else if (arg->expr->ts.type == BT_CLASS)
  	{
! 	  if (UNLIMITED_POLY (source_expr)
! 	      && DECL_LANG_SPECIFIC (source_expr->symtree->n.sym->backend_decl))
! 	    class_ref = GFC_DECL_SAVED_DESCRIPTOR
! 	      (source_expr->symtree->n.sym->backend_decl);
! 	  else
! 	    class_ref = TREE_OPERAND (argse.expr, 0);
  	  tmp = gfc_class_vtab_size_get (class_ref);
  	  if (UNLIMITED_POLY (arg->expr))
  	    tmp = gfc_resize_class_size_with_len (&argse.pre, class_ref, tmp);
diff -Nrcpad gcc-13-20251002/gcc/postreload.cc gcc-13-20251009/gcc/postreload.cc
*** gcc-13-20251002/gcc/postreload.cc	Thu Oct  2 22:33:00 2025
--- gcc-13-20251009/gcc/postreload.cc	Thu Oct  9 22:32:37 2025
*************** move2add_use_add3_insn (scalar_int_mode
*** 1894,1899 ****
--- 1894,1972 ----
    return changed;
  }
  
+ /* Perform any invalidations necessary for INSN.  */
+ 
+ static void
+ reload_cse_move2add_invalidate (rtx_insn *insn)
+ {
+   for (rtx note = REG_NOTES (insn); note; note = XEXP (note, 1))
+     {
+       if (REG_NOTE_KIND (note) == REG_INC
+ 	  && REG_P (XEXP (note, 0)))
+ 	{
+ 	  /* Reset the information about this register.  */
+ 	  int regno = REGNO (XEXP (note, 0));
+ 	  if (regno < FIRST_PSEUDO_REGISTER)
+ 	    {
+ 	      move2add_record_mode (XEXP (note, 0));
+ 	      reg_mode[regno] = VOIDmode;
+ 	    }
+ 	}
+     }
+ 
+   /* There are no REG_INC notes for SP autoinc.  */
+   subrtx_var_iterator::array_type array;
+   FOR_EACH_SUBRTX_VAR (iter, array, PATTERN (insn), NONCONST)
+     {
+       rtx mem = *iter;
+       if (mem
+ 	  && MEM_P (mem)
+ 	  && GET_RTX_CLASS (GET_CODE (XEXP (mem, 0))) == RTX_AUTOINC)
+ 	{
+ 	  if (XEXP (XEXP (mem, 0), 0) == stack_pointer_rtx)
+ 	    reg_mode[STACK_POINTER_REGNUM] = VOIDmode;
+ 	}
+     }
+ 
+   note_stores (insn, move2add_note_store, insn);
+ 
+   /* If INSN is a conditional branch, we try to extract an
+      implicit set out of it.  */
+   if (any_condjump_p (insn))
+     {
+       rtx cnd = fis_get_condition (insn);
+ 
+       if (cnd != NULL_RTX
+ 	  && GET_CODE (cnd) == NE
+ 	  && REG_P (XEXP (cnd, 0))
+ 	  && !reg_set_p (XEXP (cnd, 0), insn)
+ 	  /* The following two checks, which are also in
+ 	     move2add_note_store, are intended to reduce the
+ 	     number of calls to gen_rtx_SET to avoid memory
+ 	     allocation if possible.  */
+ 	  && SCALAR_INT_MODE_P (GET_MODE (XEXP (cnd, 0)))
+ 	  && REG_NREGS (XEXP (cnd, 0)) == 1
+ 	  && CONST_INT_P (XEXP (cnd, 1)))
+ 	{
+ 	  rtx implicit_set = gen_rtx_SET (XEXP (cnd, 0), XEXP (cnd, 1));
+ 	  move2add_note_store (SET_DEST (implicit_set), implicit_set, insn);
+ 	}
+     }
+ 
+   /* If this is a CALL_INSN, all call used registers are stored with
+      unknown values.  */
+   if (CALL_P (insn))
+     {
+       function_abi callee_abi = insn_callee_abi (insn);
+       for (int i = FIRST_PSEUDO_REGISTER - 1; i >= 0; i--)
+ 	if (reg_mode[i] != VOIDmode
+ 	    && reg_mode[i] != BLKmode
+ 	    && callee_abi.clobbers_reg_p (reg_mode[i], i))
+ 	    /* Reset the information about this register.  */
+ 	  reg_mode[i] = VOIDmode;
+     }
+ }
+ 
  /* Convert move insns with constant inputs to additions if they are cheaper.
     Return true if any changes were made.  */
  static bool
*************** reload_cse_move2add (rtx_insn *first)
*** 1916,1922 ****
    move2add_luid = 2;
    for (insn = first; insn; insn = NEXT_INSN (insn), move2add_luid++)
      {
!       rtx pat, note;
  
        if (LABEL_P (insn))
  	{
--- 1989,1995 ----
    move2add_luid = 2;
    for (insn = first; insn; insn = NEXT_INSN (insn), move2add_luid++)
      {
!       rtx pat;
  
        if (LABEL_P (insn))
  	{
*************** reload_cse_move2add (rtx_insn *first)
*** 2034,2039 ****
--- 2107,2118 ----
  			delete_insn (insn);
  		      changed |= success;
  		      insn = next;
+ 		      /* Make sure to perform any invalidations related to
+ 			 NEXT/INSN since we're going to bypass the normal
+ 			 flow with the continue below.
+ 
+ 			 Do this before recording the new mode/offset.  */
+ 		      reload_cse_move2add_invalidate (insn);
  		      move2add_record_mode (reg);
  		      reg_offset[regno]
  			= trunc_int_for_mode (added_offset + base_offset,
*************** reload_cse_move2add (rtx_insn *first)
*** 2087,2160 ****
  	      continue;
  	    }
  	}
! 
!       for (note = REG_NOTES (insn); note; note = XEXP (note, 1))
! 	{
! 	  if (REG_NOTE_KIND (note) == REG_INC
! 	      && REG_P (XEXP (note, 0)))
! 	    {
! 	      /* Reset the information about this register.  */
! 	      int regno = REGNO (XEXP (note, 0));
! 	      if (regno < FIRST_PSEUDO_REGISTER)
! 		{
! 		  move2add_record_mode (XEXP (note, 0));
! 		  reg_mode[regno] = VOIDmode;
! 		}
! 	    }
! 	}
! 
!       /* There are no REG_INC notes for SP autoinc.  */
!       subrtx_var_iterator::array_type array;
!       FOR_EACH_SUBRTX_VAR (iter, array, PATTERN (insn), NONCONST)
! 	{
! 	  rtx mem = *iter;
! 	  if (mem
! 	      && MEM_P (mem)
! 	      && GET_RTX_CLASS (GET_CODE (XEXP (mem, 0))) == RTX_AUTOINC)
! 	    {
! 	      if (XEXP (XEXP (mem, 0), 0) == stack_pointer_rtx)
! 		reg_mode[STACK_POINTER_REGNUM] = VOIDmode;
! 	    }
! 	}
! 
!       note_stores (insn, move2add_note_store, insn);
! 
!       /* If INSN is a conditional branch, we try to extract an
! 	 implicit set out of it.  */
!       if (any_condjump_p (insn))
! 	{
! 	  rtx cnd = fis_get_condition (insn);
! 
! 	  if (cnd != NULL_RTX
! 	      && GET_CODE (cnd) == NE
! 	      && REG_P (XEXP (cnd, 0))
! 	      && !reg_set_p (XEXP (cnd, 0), insn)
! 	      /* The following two checks, which are also in
! 		 move2add_note_store, are intended to reduce the
! 		 number of calls to gen_rtx_SET to avoid memory
! 		 allocation if possible.  */
! 	      && SCALAR_INT_MODE_P (GET_MODE (XEXP (cnd, 0)))
! 	      && REG_NREGS (XEXP (cnd, 0)) == 1
! 	      && CONST_INT_P (XEXP (cnd, 1)))
! 	    {
! 	      rtx implicit_set =
! 		gen_rtx_SET (XEXP (cnd, 0), XEXP (cnd, 1));
! 	      move2add_note_store (SET_DEST (implicit_set), implicit_set, insn);
! 	    }
! 	}
! 
!       /* If this is a CALL_INSN, all call used registers are stored with
! 	 unknown values.  */
!       if (CALL_P (insn))
! 	{
! 	  function_abi callee_abi = insn_callee_abi (insn);
! 	  for (i = FIRST_PSEUDO_REGISTER - 1; i >= 0; i--)
! 	    if (reg_mode[i] != VOIDmode
! 		&& reg_mode[i] != BLKmode
! 		&& callee_abi.clobbers_reg_p (reg_mode[i], i))
! 	      /* Reset the information about this register.  */
! 	      reg_mode[i] = VOIDmode;
! 	}
      }
    return changed;
  }
--- 2166,2172 ----
  	      continue;
  	    }
  	}
!       reload_cse_move2add_invalidate (insn);
      }
    return changed;
  }
diff -Nrcpad gcc-13-20251002/gcc/testsuite/ChangeLog gcc-13-20251009/gcc/testsuite/ChangeLog
*** gcc-13-20251002/gcc/testsuite/ChangeLog	Thu Oct  2 22:33:00 2025
--- gcc-13-20251009/gcc/testsuite/ChangeLog	Thu Oct  9 22:32:37 2025
***************
*** 1,3 ****
--- 1,19 ----
+ 2025-10-05  Harald Anlauf  <anlauf@gmx.de>
+ 
+ 	Backported from master:
+ 	2025-09-03  Harald Anlauf  <anlauf@gmx.de>
+ 
+ 	PR fortran/121263
+ 	* gfortran.dg/transfer_class_5.f90: New test.
+ 
+ 2025-10-03  Jeff Law  <jlaw@ventanamicro.com>
+ 
+ 	Backported from master:
+ 	2023-06-12  Jeff Law  <jlaw@ventanamicro.com>
+ 
+ 	PR rtl-optimization/101188
+ 	* gcc.c-torture/execute/pr101188.c: New test
+ 
  2025-09-18  hongtao.liu  <hongtao.liu@intel.com>
  
  	Backported from master:
diff -Nrcpad gcc-13-20251002/gcc/testsuite/gcc.c-torture/execute/pr101188.c gcc-13-20251009/gcc/testsuite/gcc.c-torture/execute/pr101188.c
*** gcc-13-20251002/gcc/testsuite/gcc.c-torture/execute/pr101188.c	Thu Jan  1 00:00:00 1970
--- gcc-13-20251009/gcc/testsuite/gcc.c-torture/execute/pr101188.c	Thu Oct  9 22:32:49 2025
***************
*** 0 ****
--- 1,61 ----
+ /* { dg-require-effective-target indirect_calls } */
+ typedef __UINT8_TYPE__ uint8_t;
+ typedef __UINT16_TYPE__ uint16_t;
+ 
+ typedef uint8_t (*fn1)(void *a);
+ typedef void (*fn2)(void *a, int *arg);
+ 
+ struct S
+ {
+     uint8_t buffer[64];
+     uint16_t n;
+     fn2 f2;
+     void *a;
+     fn1 f1;
+ };
+ 
+ volatile uint16_t x;
+ 
+ void __attribute__((__noinline__,__noclone__))
+ foo (uint16_t n)
+ {
+   x = n;
+ }
+ 
+ void __attribute__((__noinline__,__noclone__))
+ testfn (struct S *self)
+ {
+     int arg;
+ 
+     foo (self->n);
+     self->n++;
+     self->f2 (self->a, &arg);
+     self->buffer[0] = self->f1 (self->a);
+ }
+ 
+ static unsigned char myfn2_called = 0;
+ 
+ static void
+ myfn2 (void *a, int *arg)
+ {
+   myfn2_called = 1;
+ }
+ 
+ static uint8_t
+ myfn1 (void *a)
+ {
+   return 0;
+ }
+ 
+ int main (void)
+ {
+   struct S s;
+   s.n = 0;
+   s.f2 = myfn2;
+   s.f1 = myfn1;
+   testfn (&s);
+   if (myfn2_called != 1)
+     __builtin_abort();
+   return 0;
+ }
+ 
diff -Nrcpad gcc-13-20251002/gcc/testsuite/gfortran.dg/transfer_class_5.f90 gcc-13-20251009/gcc/testsuite/gfortran.dg/transfer_class_5.f90
*** gcc-13-20251002/gcc/testsuite/gfortran.dg/transfer_class_5.f90	Thu Jan  1 00:00:00 1970
--- gcc-13-20251009/gcc/testsuite/gfortran.dg/transfer_class_5.f90	Thu Oct  9 22:33:03 2025
***************
*** 0 ****
--- 1,53 ----
+ ! { dg-do run }
+ ! PR fortran/121263 - fix TRANSFER with rank 1 unlimited polymorhpic
+ !
+ ! Based on original testcase by Chris Cox.
+ 
+ module stdlib_hashmap_wrappers
+   implicit none
+ contains
+   subroutine set_rank_one_key_int( key, value )
+     integer, allocatable, intent(inout) :: key(:)
+     class(*), intent(in)                :: value(:)
+     key = transfer( value, key )
+   end subroutine
+ 
+   subroutine set_rank_one_key_cx ( key, value )
+     complex, allocatable, intent(inout) :: key(:)
+     class(*), intent(in)                :: value(:)
+     key = transfer( value, key )
+   end subroutine
+ 
+   subroutine set_first_key_int   ( key, value )
+     integer, intent(inout) :: key
+     class(*), intent(in)   :: value(:)
+     key = transfer( value(1), key )
+   end subroutine
+ end module
+ 
+ program p
+   use stdlib_hashmap_wrappers
+   implicit none
+   integer, allocatable :: a(:), b(:)
+   complex, allocatable :: c(:), d(:)
+   class(*),allocatable :: z(:)
+   integer :: m
+   a = [1, 2, 3, 4, 5]
+   c = cmplx (a, -a)
+   call set_rank_one_key_int (b, a)
+   call set_rank_one_key_cx  (d, c)
+   call set_first_key_int    (m, a)
+ ! print *, b
+ ! print *, d
+   if (size (a) /= size (b)) stop 1
+   if (any  (a  /=       b)) stop 2
+   if (size (c) /= size (d)) stop 3
+   if (any  (c  /=       d)) stop 4
+   if (m /= 1) stop 5
+   deallocate (d)
+   z = c
+   d = transfer (z, d)
+   if (size (c) /= size (d)) stop 6
+   if (any  (c  /=       d)) stop 7
+   deallocate (a, b, c, d, z)
+ end program p
