--- /dev/null
+Fixes GCC PR36350
+
+--- a/gcc/regrename.c
++++ b/gcc/regrename.c
+@@ -783,6 +783,10 @@ build_def_use (basic_block bb)
+ recog_data.operand_type[i] = OP_INOUT;
+ }
+
++ /* Unshare dup_loc RTL */
++ for (i = 0; i < recog_data.n_dups; i++)
++ *recog_data.dup_loc[i] = copy_rtx(*recog_data.dup_loc[i]);
++
+ /* Step 1: Close chains for which we have overlapping reads. */
+ for (i = 0; i < n_ops; i++)
+ scan_rtx (insn, recog_data.operand_loc[i],
+@@ -813,7 +817,7 @@ build_def_use (basic_block bb)
+ OP_IN, 0);
+
+ for (i = 0; i < recog_data.n_dups; i++)
+- *recog_data.dup_loc[i] = copy_rtx (old_dups[i]);
++ *recog_data.dup_loc[i] = old_dups[i];
+ for (i = 0; i < n_ops; i++)
+ *recog_data.operand_loc[i] = old_operands[i];
+ if (recog_data.n_dups)
--- /dev/null
+Fixes GCC PR36350
+
+--- a/gcc/regrename.c
++++ b/gcc/regrename.c
+@@ -783,6 +783,10 @@ build_def_use (basic_block bb)
+ recog_data.operand_type[i] = OP_INOUT;
+ }
+
++ /* Unshare dup_loc RTL */
++ for (i = 0; i < recog_data.n_dups; i++)
++ *recog_data.dup_loc[i] = copy_rtx(*recog_data.dup_loc[i]);
++
+ /* Step 1: Close chains for which we have overlapping reads. */
+ for (i = 0; i < n_ops; i++)
+ scan_rtx (insn, recog_data.operand_loc[i],
+@@ -813,7 +817,7 @@ build_def_use (basic_block bb)
+ OP_IN, 0);
+
+ for (i = 0; i < recog_data.n_dups; i++)
+- *recog_data.dup_loc[i] = copy_rtx (old_dups[i]);
++ *recog_data.dup_loc[i] = old_dups[i];
+ for (i = 0; i < n_ops; i++)
+ *recog_data.operand_loc[i] = old_operands[i];
+ if (recog_data.n_dups)
--- /dev/null
+Fixes GCC PR36350
+
+--- a/gcc/regrename.c
++++ b/gcc/regrename.c
+@@ -783,6 +783,10 @@ build_def_use (basic_block bb)
+ recog_data.operand_type[i] = OP_INOUT;
+ }
+
++ /* Unshare dup_loc RTL */
++ for (i = 0; i < recog_data.n_dups; i++)
++ *recog_data.dup_loc[i] = copy_rtx(*recog_data.dup_loc[i]);
++
+ /* Step 1: Close chains for which we have overlapping reads. */
+ for (i = 0; i < n_ops; i++)
+ scan_rtx (insn, recog_data.operand_loc[i],
+@@ -813,7 +817,7 @@ build_def_use (basic_block bb)
+ OP_IN, 0);
+
+ for (i = 0; i < recog_data.n_dups; i++)
+- *recog_data.dup_loc[i] = copy_rtx (old_dups[i]);
++ *recog_data.dup_loc[i] = old_dups[i];
+ for (i = 0; i < n_ops; i++)
+ *recog_data.operand_loc[i] = old_operands[i];
+ if (recog_data.n_dups)