diff options
author | Jakub Jelinek <jakub@redhat.com> | 2005-03-10 22:26:12 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2005-03-10 22:26:12 +0100 |
commit | 985f2d8fa38d5c97b7f28208f0a571a568622039 (patch) | |
tree | 9cfc0de0e97b1d9ecbd24b272c39d0c35a91f478 /gcc/combine.c | |
parent | cf379ac0a68c591dfe755cea2dd48e6517f5cfb3 (diff) | |
download | gcc-985f2d8fa38d5c97b7f28208f0a571a568622039.zip gcc-985f2d8fa38d5c97b7f28208f0a571a568622039.tar.gz gcc-985f2d8fa38d5c97b7f28208f0a571a568622039.tar.bz2 |
re PR target/20322 (Miscompilation of libcpp/expr.c at -O2+)
PR target/20322
* combine.c (try_combine): If recog_for_combine added CLOBBERs
to NEWI2PAT, fail to combine if they are used by NEWPAT.
* gcc.dg/20050307-1.c: New test.
From-SVN: r96260
Diffstat (limited to 'gcc/combine.c')
-rw-r--r-- | gcc/combine.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index 0fc1f5f..ae20c51 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -2417,6 +2417,20 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) SUBST (*split, newdest); i2_code_number = recog_for_combine (&newi2pat, i2, &new_i2_notes); + /* recog_for_combine might have added CLOBBERs to newi2pat. + Make sure NEWPAT does not depend on the clobbered regs. */ + if (GET_CODE (newi2pat) == PARALLEL) + for (i = XVECLEN (newi2pat, 0) - 1; i >= 0; i--) + if (GET_CODE (XVECEXP (newi2pat, 0, i)) == CLOBBER) + { + rtx reg = XEXP (XVECEXP (newi2pat, 0, i), 0); + if (reg_overlap_mentioned_p (reg, newpat)) + { + undo_all (); + return 0; + } + } + /* If the split point was a MULT and we didn't have one before, don't use one now. */ if (i2_code_number >= 0 && ! (split_code == MULT && ! have_mult)) |