diff options
author | Jim Wilson <wilson@gcc.gnu.org> | 1997-03-18 13:10:44 -0800 |
---|---|---|
committer | Jim Wilson <wilson@gcc.gnu.org> | 1997-03-18 13:10:44 -0800 |
commit | 987e845a7fe19a79966f3fe63b292eb98e7b3035 (patch) | |
tree | 9a4d960c0cc46025f3f0265320a59e9178aa4fac /gcc | |
parent | f75487ff658dfb9bff53d6520da3cc4ceeec3181 (diff) | |
download | gcc-987e845a7fe19a79966f3fe63b292eb98e7b3035.zip gcc-987e845a7fe19a79966f3fe63b292eb98e7b3035.tar.gz gcc-987e845a7fe19a79966f3fe63b292eb98e7b3035.tar.bz2 |
(if_then_else_cond): Call copy_rtx to prevent sharing.
From-SVN: r13736
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/combine.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index 89f6525..2832871 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -6512,6 +6512,14 @@ if_then_else_cond (x, ptrue, pfalse) if ((cond0 != 0 || cond1 != 0) && ! (cond0 != 0 && cond1 != 0 && ! rtx_equal_p (cond0, cond1))) { + /* If if_then_else_cond returned zero, then true/false are the + same rtl. We must copy one of them to prevent invalid rtl + sharing. */ + if (cond0 == 0) + true0 = copy_rtx (true0); + else if (cond1 == 0) + true1 = copy_rtx (true1); + *ptrue = gen_binary (code, mode, true0, true1); *pfalse = gen_binary (code, mode, false0, false1); return cond0 ? cond0 : cond1; |