diff options
author | James E Wilson <wilson@specifixinc.com> | 2006-12-12 16:03:39 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2006-12-12 16:03:39 +0100 |
commit | b5425e756b286c723d4b53129957f6e2aa1715f0 (patch) | |
tree | 559633eed34ade6f4a5846e16fa4c3474b81f543 /gcc | |
parent | 90fb678b67b084bbb5d724c01ceb6fbfa2f09269 (diff) | |
download | gcc-b5425e756b286c723d4b53129957f6e2aa1715f0.zip gcc-b5425e756b286c723d4b53129957f6e2aa1715f0.tar.gz gcc-b5425e756b286c723d4b53129957f6e2aa1715f0.tar.bz2 |
re PR rtl-optimization/27761 (combine miscompiles)
PR rtl-optimization/27761
* combine.c (try_combine): Don't create a useless garbage SET
if PATTERN (i2) is a PARALLEL. If added_sets_1, save
PATTERN (i1) resp. SET from i1src to i1dest in i1pat
and use it to prevent accidental modification of i1src.
Co-Authored-By: Jakub Jelinek <jakub@redhat.com>
From-SVN: r119785
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/combine.c | 27 |
2 files changed, 26 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 23721c4..a857f9a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2006-12-12 Jim Wilson <wilson@specifix.com> + Jakub Jelinek <jakub@redhat.com> + + PR rtl-optimization/27761 + * combine.c (try_combine): Don't create a useless garbage SET + if PATTERN (i2) is a PARALLEL. If added_sets_1, save + PATTERN (i1) resp. SET from i1src to i1dest in i1pat + and use it to prevent accidental modification of i1src. + 2006-12-12 Ira Rosen <irar@il.ibm.com> * tree-vect-analyze.c (vect_analyze_data_ref_access): Add another check diff --git a/gcc/combine.c b/gcc/combine.c index 7f75f9d..32117be 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -1819,8 +1819,8 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) rtx i3dest_killed = 0; /* SET_DEST and SET_SRC of I2 and I1. */ rtx i2dest, i2src, i1dest = 0, i1src = 0; - /* PATTERN (I2), or a copy of it in certain cases. */ - rtx i2pat; + /* PATTERN (I1) and PATTERN (I2), or a copy of it in certain cases. */ + rtx i1pat = 0, i2pat = 0; /* Indicates if I2DEST or I1DEST is in I2SRC or I1_SRC. */ int i2dest_in_i2src = 0, i1dest_in_i1src = 0, i2dest_in_i1src = 0; int i2dest_killed = 0, i1dest_killed = 0; @@ -2218,12 +2218,21 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) rtx. If I2 is a PARALLEL, we just need the piece that assigns I2SRC to I2DEST. */ - i2pat = (GET_CODE (PATTERN (i2)) == PARALLEL - ? gen_rtx_SET (VOIDmode, i2dest, i2src) - : PATTERN (i2)); - if (added_sets_2) - i2pat = copy_rtx (i2pat); + { + if (GET_CODE (PATTERN (i2)) == PARALLEL) + i2pat = gen_rtx_SET (VOIDmode, i2dest, copy_rtx (i2src)); + else + i2pat = copy_rtx (PATTERN (i2)); + } + + if (added_sets_1) + { + if (GET_CODE (PATTERN (i1)) == PARALLEL) + i1pat = gen_rtx_SET (VOIDmode, i1dest, copy_rtx (i1src)); + else + i1pat = copy_rtx (PATTERN (i1)); + } combine_merges++; @@ -2418,9 +2427,7 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) } if (added_sets_1) - XVECEXP (newpat, 0, --total_sets) - = (GET_CODE (PATTERN (i1)) == PARALLEL - ? gen_rtx_SET (VOIDmode, i1dest, i1src) : PATTERN (i1)); + XVECEXP (newpat, 0, --total_sets) = i1pat; if (added_sets_2) { |