https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66279
--- Comment #12 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-12 branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:fa2079742b1564fea6d84141c11ceb79f758b371 commit r12-11240-gfa2079742b1564fea6d84141c11ceb79f758b371 Author: Richard Biener <rguent...@suse.de> Date: Fri Feb 28 09:58:36 2025 +0100 middle-end/66279 - gimplification clobbers shared asm constraints When the C++ frontend clones a CTOR we do not copy ASM_EXPR constraints fully as walk_tree does not recurse to TREE_PURPOSE of TREE_LIST nodes. At this point doing that seems too dangerous so the following instead avoids gimplification of ASM_EXPRs to clobber the shared constraints and unshares it there, like it also unshares TREE_VALUE when it re-writes a "+" output constraint to separate "=" output and matching input constraint. PR middle-end/66279 * gimplify.cc (gimplify_asm_expr): Copy TREE_PURPOSE before rewriting it for "+" processing. * g++.dg/pr66279.C: New testcase. (cherry picked from commit 95f5d6cc17e7d6b689674756c62b6b5e1284afd0)