diff -Nrcpad gcc-14-20250919/LAST_UPDATED gcc-14-20250926/LAST_UPDATED
*** gcc-14-20250919/LAST_UPDATED	Fri Sep 19 22:33:24 2025
--- gcc-14-20250926/LAST_UPDATED	Fri Sep 26 22:35:15 2025
***************
*** 1 ****
! Obtained from git: releases/gcc-14 revision 0f44647a337275fc3cc96c07afd1eb20b5b1651b
--- 1 ----
! Obtained from git: releases/gcc-14 revision 03e361b359daabfc87c83be7a397b8390d725c63
diff -Nrcpad gcc-14-20250919/MD5SUMS gcc-14-20250926/MD5SUMS
*** gcc-14-20250919/MD5SUMS	Fri Sep 19 22:33:29 2025
--- gcc-14-20250926/MD5SUMS	Fri Sep 26 22:35:19 2025
***************
*** 1,5 ****
  # This file contains the MD5 checksums of the files in the
! # gcc-14-20250919.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-14-20250926.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
*************** fc9280b02bc68e4fb1ef8d51ccc25061  Change
*** 23,29 ****
  fd4ecdf5d672efe2b0e409aca9cf9446  ChangeLog.jit
  09538b708302f1735f6fa05b622ecf5e  ChangeLog.tree-ssa
  24ab760126489e69436a43185dc3d202  INSTALL/README
! baf15366fd85cf2d1e3b144856d38660  LAST_UPDATED
  1671040823f8eb8436a06fdd18065e02  MAINTAINERS
  304c3887135aefa27c21292ec585b0a3  Makefile.def
  8dd93fbf2e32bcbd2faba10e3b8ba2b0  Makefile.in
--- 23,29 ----
  fd4ecdf5d672efe2b0e409aca9cf9446  ChangeLog.jit
  09538b708302f1735f6fa05b622ecf5e  ChangeLog.tree-ssa
  24ab760126489e69436a43185dc3d202  INSTALL/README
! 1e4c76a01d3a57878a48637bedf7a989  LAST_UPDATED
  1671040823f8eb8436a06fdd18065e02  MAINTAINERS
  304c3887135aefa27c21292ec585b0a3  Makefile.def
  8dd93fbf2e32bcbd2faba10e3b8ba2b0  Makefile.in
*************** bc7394806417778d77541ba1ec0e4a70  gcc/BA
*** 505,511 ****
  a916467b91076e631dd8edb7424769c7  gcc/COPYING.LIB
  d32239bcb673463ab874e80d47fae504  gcc/COPYING3
  6a6a8e020838b23406c81b19c1d46df6  gcc/COPYING3.LIB
! 6c04cef3bfdf43982371a0e70e560192  gcc/ChangeLog
  a3b63c675afa7a655cc2bfa8a907af79  gcc/ChangeLog-1997
  d9a88529352a010253c2e8fb1ed6023b  gcc/ChangeLog-1998
  240f08f81cb4699e8b49347db38233db  gcc/ChangeLog-1999
--- 505,511 ----
  a916467b91076e631dd8edb7424769c7  gcc/COPYING.LIB
  d32239bcb673463ab874e80d47fae504  gcc/COPYING3
  6a6a8e020838b23406c81b19c1d46df6  gcc/COPYING3.LIB
! ab0499044203ecdc7cacbb05f43925b1  gcc/ChangeLog
  a3b63c675afa7a655cc2bfa8a907af79  gcc/ChangeLog-1997
  d9a88529352a010253c2e8fb1ed6023b  gcc/ChangeLog-1998
  240f08f81cb4699e8b49347db38233db  gcc/ChangeLog-1999
*************** fb3fadb88e1d2b3b640cfaaa5ff11780  gcc/Ch
*** 541,547 ****
  3eb07e0b2e542409bf73d359f7f65609  gcc/ChangeLog.ptr
  e13638e26743ba41e6011b76cc00d9a9  gcc/ChangeLog.tree-ssa
  739ab47f6425bcea1d05e4fc0542de54  gcc/ChangeLog.tuples
! 6c3356e304d26f36cbbdb8b66b5209df  gcc/DATESTAMP
  d41d8cd98f00b204e9800998ecf8427e  gcc/DEV-PHASE
  eb92e1ff5e982ca07e173e0eb286d243  gcc/FSFChangeLog
  30e1e33411566388b3164558482dc5e6  gcc/FSFChangeLog.10
--- 541,547 ----
  3eb07e0b2e542409bf73d359f7f65609  gcc/ChangeLog.ptr
  e13638e26743ba41e6011b76cc00d9a9  gcc/ChangeLog.tree-ssa
  739ab47f6425bcea1d05e4fc0542de54  gcc/ChangeLog.tuples
! 40596c20e8697f15b5f41d8a23e870be  gcc/DATESTAMP
  d41d8cd98f00b204e9800998ecf8427e  gcc/DEV-PHASE
  eb92e1ff5e982ca07e173e0eb286d243  gcc/FSFChangeLog
  30e1e33411566388b3164558482dc5e6  gcc/FSFChangeLog.10
*************** cb26f6c0709fd9533aec72a07a36bf8b  gcc/co
*** 4410,4426 ****
  225dc655e791eb82bc0cd5477d84046f  gcc/config/mcore/predicates.md
  1dd06ef15dd426381100de36055c51d7  gcc/config/mcore/t-mcore
  82487fb2fbd50cb690ac1b406b085737  gcc/config/microblaze/constraints.md
  9b8779320526aa5f273de983bdc206ce  gcc/config/microblaze/linux.h
  ef3714e630d226fc9f9a52d072ae6d49  gcc/config/microblaze/microblaze-c.cc
! 5b4dece5790de432c81f12521dc1c3f8  gcc/config/microblaze/microblaze-protos.h
! d500089903fa2f61e36c3c09c952a269  gcc/config/microblaze/microblaze.cc
  15444436357947286ccf30f90e3a28c8  gcc/config/microblaze/microblaze.h
! c16b6c77f514fb5e2247d16dcfcc5b22  gcc/config/microblaze/microblaze.md
  38180380f0c251974ab87d52c6680c1f  gcc/config/microblaze/microblaze.opt
  ab7ecb87ef3b7a388cab0e4d0d2eb0db  gcc/config/microblaze/microblaze.opt.urls
  6122aa8145720d14b86bdf0e7a6171f5  gcc/config/microblaze/predicates.md
  24cc98144fc2514eb9d0a4959efcba46  gcc/config/microblaze/rtems.h
! 8abeae4e9debaaeb4950f5fdff621fbc  gcc/config/microblaze/sync.md
  df031372af9c825d21d2058d266247a0  gcc/config/microblaze/t-microblaze
  63ccba4e7f745d36609d7c129bac6288  gcc/config/microblaze/t-microblaze-linux
  a8b08640136e3e7712d2278eb84c21d9  gcc/config/microblaze/t-rtems
--- 4410,4427 ----
  225dc655e791eb82bc0cd5477d84046f  gcc/config/mcore/predicates.md
  1dd06ef15dd426381100de36055c51d7  gcc/config/mcore/t-mcore
  82487fb2fbd50cb690ac1b406b085737  gcc/config/microblaze/constraints.md
+ 1ac49ffd4d6e30329a7a425da3ce8eaa  gcc/config/microblaze/iterators.md
  9b8779320526aa5f273de983bdc206ce  gcc/config/microblaze/linux.h
  ef3714e630d226fc9f9a52d072ae6d49  gcc/config/microblaze/microblaze-c.cc
! b0b66bee3fc32ec734dbbba003615857  gcc/config/microblaze/microblaze-protos.h
! a89f9732934dd5c153ba3abb3d72f182  gcc/config/microblaze/microblaze.cc
  15444436357947286ccf30f90e3a28c8  gcc/config/microblaze/microblaze.h
! 9be6b5fdaac09c5ef72078e45f238e8b  gcc/config/microblaze/microblaze.md
  38180380f0c251974ab87d52c6680c1f  gcc/config/microblaze/microblaze.opt
  ab7ecb87ef3b7a388cab0e4d0d2eb0db  gcc/config/microblaze/microblaze.opt.urls
  6122aa8145720d14b86bdf0e7a6171f5  gcc/config/microblaze/predicates.md
  24cc98144fc2514eb9d0a4959efcba46  gcc/config/microblaze/rtems.h
! 57680319f185e67ab8f12c85e635430f  gcc/config/microblaze/sync.md
  df031372af9c825d21d2058d266247a0  gcc/config/microblaze/t-microblaze
  63ccba4e7f745d36609d7c129bac6288  gcc/config/microblaze/t-microblaze-linux
  a8b08640136e3e7712d2278eb84c21d9  gcc/config/microblaze/t-rtems
*************** dce7dac7e905ada28c6563d930b531eb  gcc/fo
*** 5872,5878 ****
  090850db6c719557b18e35fafc041a4c  gcc/fold-const.cc
  62f9c541bc34eb653f289ecd29c7848a  gcc/fold-const.h
  5cce8057cb6a40c0ce23fcd6497d35c0  gcc/fold-mem-offsets.cc
! b9ebbcb3695e3e356b3316ebafde4d58  gcc/fortran/ChangeLog
  3330102ad3a0217cba963be6b5eefd58  gcc/fortran/ChangeLog-2002
  d000ab985b1eeb1ad5749f98b8fef99f  gcc/fortran/ChangeLog-2003
  bf42f94f0c51dcc7d8051cc7fda1efdc  gcc/fortran/ChangeLog-2004
--- 5873,5879 ----
  090850db6c719557b18e35fafc041a4c  gcc/fold-const.cc
  62f9c541bc34eb653f289ecd29c7848a  gcc/fold-const.h
  5cce8057cb6a40c0ce23fcd6497d35c0  gcc/fold-mem-offsets.cc
! 1214b43630828e38490c297a7dbe73a4  gcc/fortran/ChangeLog
  3330102ad3a0217cba963be6b5eefd58  gcc/fortran/ChangeLog-2002
  d000ab985b1eeb1ad5749f98b8fef99f  gcc/fortran/ChangeLog-2003
  bf42f94f0c51dcc7d8051cc7fda1efdc  gcc/fortran/ChangeLog-2004
*************** ba11ab9ac11e6a78fa7706263e42f1fc  gcc/fo
*** 5949,5955 ****
  56af741644ab30aa09221a750079e265  gcc/fortran/parse.cc
  6afe26dd3f7a33ff8c524687d1958f05  gcc/fortran/parse.h
  a0e2907182a3f4a299681840e8f5be43  gcc/fortran/primary.cc
! 241cf6809911c98dd99b5ae8fbb1b747  gcc/fortran/resolve.cc
  bf73188a78ecc3c99bc6915db827d75f  gcc/fortran/scanner.cc
  1cfffbabece85f419a6ca2676917e619  gcc/fortran/scanner.h
  be0b83b5f771bbe50926a1109ebd9e09  gcc/fortran/simplify.cc
--- 5950,5956 ----
  56af741644ab30aa09221a750079e265  gcc/fortran/parse.cc
  6afe26dd3f7a33ff8c524687d1958f05  gcc/fortran/parse.h
  a0e2907182a3f4a299681840e8f5be43  gcc/fortran/primary.cc
! a167cfad47f769840c423ea75485e9f7  gcc/fortran/resolve.cc
  bf73188a78ecc3c99bc6915db827d75f  gcc/fortran/scanner.cc
  1cfffbabece85f419a6ca2676917e619  gcc/fortran/scanner.h
  be0b83b5f771bbe50926a1109ebd9e09  gcc/fortran/simplify.cc
*************** e8a9eb01b9451a357155e7152df1c669  gcc/ta
*** 8060,8066 ****
  a05663c52c607143c607d3ecf1391979  gcc/targhooks.cc
  51d240e574a3f9ecec346d64a04ac634  gcc/targhooks.h
  f39fcaa8197187283ccfed40107b426d  gcc/testsuite/.gitattributes
! b7c2ff8c08ffe94dd44d18591ffd770c  gcc/testsuite/ChangeLog
  862f04afbd87da2cc6bc432c3f28430f  gcc/testsuite/ChangeLog-1993-2007
  029a5d8dacd25eb5d4711452ac448e5b  gcc/testsuite/ChangeLog-2008
  13ac28c41d51b66b4ec40dba6bd50f39  gcc/testsuite/ChangeLog-2009
--- 8061,8067 ----
  a05663c52c607143c607d3ecf1391979  gcc/targhooks.cc
  51d240e574a3f9ecec346d64a04ac634  gcc/targhooks.h
  f39fcaa8197187283ccfed40107b426d  gcc/testsuite/.gitattributes
! 46de3e21ad8e2abd4c3f62e3de5fc866  gcc/testsuite/ChangeLog
  862f04afbd87da2cc6bc432c3f28430f  gcc/testsuite/ChangeLog-1993-2007
  029a5d8dacd25eb5d4711452ac448e5b  gcc/testsuite/ChangeLog-2008
  13ac28c41d51b66b4ec40dba6bd50f39  gcc/testsuite/ChangeLog-2009
*************** c6d3d1ffedb5b952a8712db0cf31c809  gcc/te
*** 99248,99253 ****
--- 99249,99255 ----
  45bdaaba50a371d379854f3b6895d276  gcc/testsuite/gfortran.dg/pr88964.f90
  d0e021239a321dbde0c39d7f370068c8  gcc/testsuite/gfortran.dg/pr89077.f90
  a2461a16a54c67eb1031deda70d3c512  gcc/testsuite/gfortran.dg/pr89084.f90
+ f3fbf1380652a88bf0a5d643b52e4a3d  gcc/testsuite/gfortran.dg/pr89092.f90
  be4f5532cbaa58d083d822b627ffe5de  gcc/testsuite/gfortran.dg/pr89253.f
  eb191e16157f03cba56fb00422bb2852  gcc/testsuite/gfortran.dg/pr89266.f90
  2726f9a132f249a727072d95e5f0aee3  gcc/testsuite/gfortran.dg/pr89344.f90
diff -Nrcpad gcc-14-20250919/gcc/ChangeLog gcc-14-20250926/gcc/ChangeLog
*** gcc-14-20250919/gcc/ChangeLog	Fri Sep 19 22:32:19 2025
--- gcc-14-20250926/gcc/ChangeLog	Fri Sep 26 22:32:40 2025
***************
*** 1,3 ****
--- 1,16 ----
+ 2025-09-20  Michael Eager  <eager@eagercon.com>
+ 
+ 	PR target/118280
+ 	* config/microblaze/iterators.md: New.
+ 	* config/microblaze/microblaze-protos.h: Add
+ 	microblaze_subword_address.
+ 	* config/microblaze/microblaze.cc: Ditto.
+ 	* config/microblaze/microblaze.md: constants: Add UNSPECV_CAS_BOOL,
+ 	UNSPECV_CAS_MEM, UNSPECV_CAS_VAL, UNSPECV_ATOMIC_FETCH_OP
+ 	type: add atomic
+ 	* config/microblaze/sync.md: Add atomic_fetch_<atomic_optab>si
+ 	atomic_test_and_set
+ 
  2025-09-18  hongtao.liu  <hongtao.liu@intel.com>
  
  	Backported from master:
diff -Nrcpad gcc-14-20250919/gcc/DATESTAMP gcc-14-20250926/gcc/DATESTAMP
*** gcc-14-20250919/gcc/DATESTAMP	Fri Sep 19 22:32:19 2025
--- gcc-14-20250926/gcc/DATESTAMP	Fri Sep 26 22:32:40 2025
***************
*** 1 ****
! 20250919
--- 1 ----
! 20250926
diff -Nrcpad gcc-14-20250919/gcc/config/microblaze/iterators.md gcc-14-20250926/gcc/config/microblaze/iterators.md
*** gcc-14-20250919/gcc/config/microblaze/iterators.md	Thu Jan  1 00:00:00 1970
--- gcc-14-20250926/gcc/config/microblaze/iterators.md	Fri Sep 26 22:32:42 2025
***************
*** 0 ****
--- 1,25 ----
+ ;; Iterator definitions for GCC MicroBlaze machine description files.
+ ;; Copyright (C) 2012-2024 Free Software Foundation, Inc.
+ ;;
+ ;; This file is part of GCC.
+ ;;
+ ;; GCC is free software; you can redistribute it and/or modify
+ ;; it under the terms of the GNU General Public License as published by
+ ;; the Free Software Foundation; either version 3, or (at your option)
+ ;; any later version.
+ ;;
+ ;; GCC is distributed in the hope that it will be useful,
+ ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ ;; GNU General Public License for more details.
+ ;;
+ ;; You should have received a copy of the GNU General Public License
+ ;; along with GCC; see the file COPYING3.  If not see
+ ;; <http://www.gnu.org/licenses/>.
+ 
+ ; atomics code iterator
+ (define_code_iterator any_atomic [plus ior xor and])
+ 
+ ; atomics code attribute
+ (define_code_attr atomic_optab
+   [(plus "add") (ior "or") (xor "xor") (and "and")])
diff -Nrcpad gcc-14-20250919/gcc/config/microblaze/microblaze-protos.h gcc-14-20250926/gcc/config/microblaze/microblaze-protos.h
*** gcc-14-20250919/gcc/config/microblaze/microblaze-protos.h	Fri Sep 19 22:32:28 2025
--- gcc-14-20250926/gcc/config/microblaze/microblaze-protos.h	Fri Sep 26 22:32:42 2025
*************** extern int symbol_mentioned_p (rtx);
*** 62,67 ****
--- 62,68 ----
  extern int label_mentioned_p (rtx);
  extern bool microblaze_cannot_force_const_mem (machine_mode, rtx);
  extern void microblaze_eh_return (rtx op0);
+ extern void microblaze_subword_address (rtx, rtx *, rtx *);
  #endif  /* RTX_CODE */
  
  /* Declare functions in microblaze-c.cc.  */
diff -Nrcpad gcc-14-20250919/gcc/config/microblaze/microblaze.cc gcc-14-20250926/gcc/config/microblaze/microblaze.cc
*** gcc-14-20250919/gcc/config/microblaze/microblaze.cc	Fri Sep 19 22:32:28 2025
--- gcc-14-20250926/gcc/config/microblaze/microblaze.cc	Fri Sep 26 22:32:42 2025
*************** microblaze_expand_block_move (rtx dest,
*** 1300,1305 ****
--- 1300,1333 ----
    return false;
  }
  
+ /* Compute memory address *aligned_mem and corresponding shift value (*shift)
+    from a QImode memory reference MEM */
+ void
+ microblaze_subword_address (rtx mem, rtx *aligned_mem, rtx *shift)
+ {
+   /* Align the memory address to a word.  */
+   rtx addr = force_reg (Pmode, XEXP (mem, 0));
+ 
+   rtx addr_mask = gen_int_mode (-4, Pmode);
+ 
+   rtx aligned_addr = gen_reg_rtx (Pmode);
+ 
+   emit_move_insn (aligned_addr,  gen_rtx_AND (Pmode, addr, addr_mask));
+ 
+   *aligned_mem = change_address (mem, SImode, aligned_addr);
+ 
+   /* Calculate the shift amount.  */
+   emit_move_insn (*shift, gen_rtx_AND (SImode, addr, gen_int_mode (3, SImode)));
+ 
+   if (TARGET_LITTLE_ENDIAN == 0) {
+     emit_move_insn (*shift,
+ 		    gen_rtx_MINUS (SImode, gen_int_mode (3, SImode), *shift));
+   }
+ 
+   emit_move_insn (*shift, gen_rtx_ASHIFT (SImode, *shift,
+ 					  gen_int_mode (3, SImode)));
+ }
+ 
  static bool
  microblaze_rtx_costs (rtx x, machine_mode mode, int outer_code ATTRIBUTE_UNUSED,
  		      int opno ATTRIBUTE_UNUSED, int *total,
diff -Nrcpad gcc-14-20250919/gcc/config/microblaze/microblaze.md gcc-14-20250926/gcc/config/microblaze/microblaze.md
*** gcc-14-20250919/gcc/config/microblaze/microblaze.md	Fri Sep 19 22:32:28 2025
--- gcc-14-20250926/gcc/config/microblaze/microblaze.md	Fri Sep 26 22:32:42 2025
***************
*** 21,26 ****
--- 21,27 ----
  
  (include "constraints.md")
  (include "predicates.md")
+ (include "iterators.md")
  
  ;;----------------------------------------------------
  ;; Constants
***************
*** 43,48 ****
--- 44,53 ----
    (UNSPEC_TLS           106)    ;; jump table
    (UNSPEC_SET_TEXT      107)    ;; set text start
    (UNSPEC_TEXT          108)    ;; data text relative
+   (UNSPECV_CAS_BOOL     201)    ;; compare and swap (bool)
+   (UNSPECV_CAS_VAL      202)    ;; compare and swap (val)
+   (UNSPECV_CAS_MEM      203)    ;; compare and swap (mem)
+   (UNSPECV_ATOMIC_FETCH_OP     204)    ;; atomic fetch op
  ])
  
  (define_c_enum "unspec" [
***************
*** 79,85 ****
  ;; bshift 	Shift operations
  
  (define_attr "type"
!   "unknown,branch,jump,call,load,store,move,arith,darith,imul,idiv,icmp,multi,nop,no_delay_arith,no_delay_load,no_delay_store,no_delay_imul,no_delay_move,bshift,fadd,frsub,fmul,fdiv,fcmp,fsl,fsqrt,fcvt,trap"
    (const_string "unknown"))
  
  ;; Main data type used by the insn
--- 84,90 ----
  ;; bshift 	Shift operations
  
  (define_attr "type"
!   "unknown,branch,jump,call,load,store,move,arith,darith,imul,idiv,icmp,multi,nop,no_delay_arith,no_delay_load,no_delay_store,no_delay_imul,no_delay_move,bshift,fadd,frsub,fmul,fdiv,fcmp,fsl,fsqrt,fcvt,trap,atomic"
    (const_string "unknown"))
  
  ;; Main data type used by the insn
diff -Nrcpad gcc-14-20250919/gcc/config/microblaze/sync.md gcc-14-20250926/gcc/config/microblaze/sync.md
*** gcc-14-20250919/gcc/config/microblaze/sync.md	Fri Sep 19 22:32:28 2025
--- gcc-14-20250926/gcc/config/microblaze/sync.md	Fri Sep 26 22:32:42 2025
***************
*** 18,43 ****
  ;; <http://www.gnu.org/licenses/>.
  
  (define_insn "atomic_compare_and_swapsi"
!   [(match_operand:SI 0 "register_operand" "=&d")	;; bool output
!    (match_operand:SI 1 "register_operand" "=&d")	;; val output
!    (match_operand:SI 2 "nonimmediate_operand" "+Q")	;; memory
!    (match_operand:SI 3 "register_operand" "d")		;; expected value
!    (match_operand:SI 4 "register_operand" "d")		;; desired value
!    (match_operand:SI 5 "const_int_operand" "")		;; is_weak
!    (match_operand:SI 6 "const_int_operand" "")		;; mod_s
!    (match_operand:SI 7 "const_int_operand" "")		;; mod_f
     (clobber (match_scratch:SI 8 "=&d"))]
    ""
    {
!     output_asm_insn ("addc \tr0,r0,r0", operands);
!     output_asm_insn ("lwx  \t%1,%y2,r0", operands);
!     output_asm_insn ("addic\t%8,r0,0", operands);
!     output_asm_insn ("bnei \t%8,.-8", operands);
!     output_asm_insn ("cmp  \t%0,%1,%3", operands);
!     output_asm_insn ("bnei \t%0,.+16", operands);
!     output_asm_insn ("swx  \t%4,%y2,r0", operands);
!     output_asm_insn ("addic\t%8,r0,0", operands);
!     output_asm_insn ("bnei \t%8,.-28", operands);
!     return "";
    }
  )
--- 18,114 ----
  ;; <http://www.gnu.org/licenses/>.
  
  (define_insn "atomic_compare_and_swapsi"
!   [(set (match_operand:SI 0 "register_operand" "=&d")		;; bool output
!         (unspec_volatile:SI
!           [(match_operand:SI 2 "nonimmediate_operand" "+Q")	;; memory
!            (match_operand:SI 3 "register_operand" "d")		;; expected value
!            (match_operand:SI 4 "register_operand" "d")]		;; desired value
!           UNSPECV_CAS_BOOL))
!    (set (match_operand:SI 1 "register_operand" "=&d")		;; val output
!         (unspec_volatile:SI [(const_int 0)] UNSPECV_CAS_VAL))
!    (set (match_dup 2)
!         (unspec_volatile:SI [(const_int 0)] UNSPECV_CAS_MEM))
!    (match_operand:SI 5 "const_int_operand" "")			;; is_weak
!    (match_operand:SI 6 "const_int_operand" "")			;; mod_s
!    (match_operand:SI 7 "const_int_operand" "")			;; mod_f
     (clobber (match_scratch:SI 8 "=&d"))]
    ""
    {
!     return "add  \t%0,r0,r0\n\t"
!       "lwx  \t%1,%y2,r0\n\t"
!       "addic\t%8,r0,0\n\t"
!       "bnei \t%8,.-8\n\t"
!       "cmp  \t%8,%1,%3\n\t"
!       "bnei \t%8,.+20\n\t"
!       "swx  \t%4,%y2,r0\n\t"
!       "addic\t%8,r0,0\n\t"
!       "bnei \t%8,.-28\n\t"
!       "addi \t%0,r0,1";
    }
+   [(set_attr "type"	"atomic")
+   (set_attr "mode"	"SI")
+   (set_attr "length"	"40")]
  )
+ 
+ ;;
+ ;;
+ ;;
+ ;;
+ (define_insn "atomic_fetch_<atomic_optab>si"
+   [(set (match_operand:SI 0 "register_operand" "=&d")
+ 	(match_operand:SI 1 "memory_operand" "+Q"))
+    (set (match_dup 1)
+ 	(unspec_volatile:SI
+ 	  [(any_atomic:SI (match_dup 1)
+ 		   (match_operand:SI 2 "register_operand" "d"))
+ 	   (match_operand:SI 3 "const_int_operand")] ;; model
+ 	 UNSPECV_ATOMIC_FETCH_OP))
+    (clobber (match_scratch:SI 4 "=&d"))]	  ;; tmp_1
+   ""
+   {
+     return
+       "lwx  \t%0,%y1,r0\n\t"
+       "addic\t%4,r0,0\n\t"
+       "bnei \t%4,.-8\n\t"
+       "<atomic_optab>\t%4,%0,%2\n\t"
+       "swx  \t%4,%y1,r0\n\t"
+       "addic\t%4,r0,0\n\t"
+       "bnei \t%4,.-24";
+   }
+   [(set_attr "type"	"atomic")
+   (set_attr "mode"	"SI")
+   (set_attr "length"	"28")])
+ 
+ ;;
+ ;; MicroBlaze only supports lx/sx instructions for word mode only
+ ;;
+ ;; Use shift|mask magic to implement atomic_test_and_set using lwx/swx
+ ;;
+ (define_expand "atomic_test_and_set"
+   [(match_operand:QI 0 "register_operand" "")    ;; bool output
+    (match_operand:QI 1 "memory_operand" "m")    ;; memory
+    (match_operand:SI 2 "const_int_operand" "")]  ;; model
+   ""
+ {
+   rtx old = gen_reg_rtx (SImode);
+   rtx mem = operands[1];
+   rtx model = operands[2];
+   rtx set = gen_reg_rtx (SImode);
+   rtx aligned_mem = gen_reg_rtx (SImode);
+   rtx shift = gen_reg_rtx (SImode);
+ 
+   microblaze_subword_address (mem, &aligned_mem, &shift);
+ 
+   emit_move_insn (set, GEN_INT (1));
+   rtx shifted_set = gen_reg_rtx (SImode);
+ 
+   emit_move_insn (shifted_set, gen_rtx_ASHIFT (SImode, set, shift));
+ 
+   emit_insn (gen_atomic_fetch_orsi (old, aligned_mem, shifted_set, model));
+ 
+   emit_move_insn (old, gen_rtx_ASHIFTRT (SImode, old, shift));
+ 
+   emit_move_insn (operands[0], gen_lowpart (QImode, old));
+ 
+   DONE;
+ })
diff -Nrcpad gcc-14-20250919/gcc/fortran/ChangeLog gcc-14-20250926/gcc/fortran/ChangeLog
*** gcc-14-20250919/gcc/fortran/ChangeLog	Fri Sep 19 22:32:28 2025
--- gcc-14-20250926/gcc/fortran/ChangeLog	Fri Sep 26 22:32:44 2025
***************
*** 1,3 ****
--- 1,11 ----
+ 2025-09-23  Paul Thomas  <pault@gcc.gnu.org>
+ 
+ 	Backported from master:
+ 	2025-08-13  Paul Thomas  <pault@gcc.gnu.org>
+ 
+ 	PR fortran/89092
+ 	* resolve.cc (was_declared): Add subroutine attribute.
+ 
  2025-08-22  Harald Anlauf  <anlauf@gmx.de>
  
  	Backported from master:
diff -Nrcpad gcc-14-20250919/gcc/fortran/resolve.cc gcc-14-20250926/gcc/fortran/resolve.cc
*** gcc-14-20250919/gcc/fortran/resolve.cc	Fri Sep 19 22:32:28 2025
--- gcc-14-20250926/gcc/fortran/resolve.cc	Fri Sep 26 22:32:44 2025
*************** was_declared (gfc_symbol *sym)
*** 1611,1617 ****
    if (a.allocatable || a.dimension || a.dummy || a.external || a.intrinsic
        || a.optional || a.pointer || a.save || a.target || a.volatile_
        || a.value || a.access != ACCESS_UNKNOWN || a.intent != INTENT_UNKNOWN
!       || a.asynchronous || a.codimension)
      return 1;
  
    return 0;
--- 1611,1617 ----
    if (a.allocatable || a.dimension || a.dummy || a.external || a.intrinsic
        || a.optional || a.pointer || a.save || a.target || a.volatile_
        || a.value || a.access != ACCESS_UNKNOWN || a.intent != INTENT_UNKNOWN
!       || a.asynchronous || a.codimension || a.subroutine)
      return 1;
  
    return 0;
diff -Nrcpad gcc-14-20250919/gcc/testsuite/ChangeLog gcc-14-20250926/gcc/testsuite/ChangeLog
*** gcc-14-20250919/gcc/testsuite/ChangeLog	Fri Sep 19 22:32:29 2025
--- gcc-14-20250926/gcc/testsuite/ChangeLog	Fri Sep 26 22:32:46 2025
***************
*** 1,3 ****
--- 1,11 ----
+ 2025-09-23  Paul Thomas  <pault@gcc.gnu.org>
+ 
+ 	Backported from master:
+ 	2025-08-13  Paul Thomas  <pault@gcc.gnu.org>
+ 
+ 	PR fortran/89092
+ 	* gfortran.dg/pr89092.f90: New test.
+ 
  2025-09-18  hongtao.liu  <hongtao.liu@intel.com>
  
  	Backported from master:
diff -Nrcpad gcc-14-20250919/gcc/testsuite/gfortran.dg/pr89092.f90 gcc-14-20250926/gcc/testsuite/gfortran.dg/pr89092.f90
*** gcc-14-20250919/gcc/testsuite/gfortran.dg/pr89092.f90	Thu Jan  1 00:00:00 1970
--- gcc-14-20250926/gcc/testsuite/gfortran.dg/pr89092.f90	Fri Sep 26 22:34:45 2025
***************
*** 0 ****
--- 1,49 ----
+ ! { dg-do compile }
+ ! { dg-options "-fdump-tree-original" }
+ module AModule
+    implicit none
+    private
+    public Foo
+ 
+    interface Foo
+       module procedure FooPrivate
+    end interface
+ contains
+    subroutine FooPrivate(x)
+       integer :: x
+ 
+       write(*,*) 'Foo(integer)'
+    end subroutine
+ end module
+ module BModule
+    implicit none
+    private
+ 
+    type, public :: BType
+    contains
+       procedure :: Foo
+    end type
+ contains
+    subroutine Foo(self)
+       class(BType) :: self
+ 
+       write(*,*) 'Foo(BType)'
+    end subroutine
+ end module
+ program iface_tbp_test
+    use AModule
+    implicit none
+ 
+    call test()
+ 
+ contains
+    subroutine test()
+       use BModule
+ 
+       type(BType) :: y
+ 
+       call y%Foo()
+       call Foo(1)
+    end subroutine
+ end program
+ ! { dg-final { scan-tree-dump-times "foo \\(&class.2\\)" 1 "original" } }
