summaryrefslogtreecommitdiff
path: root/gcc/rtl.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/rtl.c')
-rw-r--r--gcc/rtl.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/rtl.c b/gcc/rtl.c
index bc49fc86fe9..b2d88f783b7 100644
--- a/gcc/rtl.c
+++ b/gcc/rtl.c
@@ -256,7 +256,11 @@ copy_rtx (rtx orig)
/* SCRATCH must be shared because they represent distinct values. */
return orig;
case CLOBBER:
- if (REG_P (XEXP (orig, 0)) && REGNO (XEXP (orig, 0)) < FIRST_PSEUDO_REGISTER)
+ /* Share clobbers of hard registers (like cc0), but do not share pseudo reg
+ clobbers or clobbers of hard registers that originated as pseudos.
+ This is needed to allow safe register renaming. */
+ if (REG_P (XEXP (orig, 0)) && REGNO (XEXP (orig, 0)) < FIRST_PSEUDO_REGISTER
+ && ORIGINAL_REGNO (XEXP (orig, 0)) == REGNO (XEXP (orig, 0)))
return orig;
break;