diff options
author | Jakub Jelinek <jakub@redhat.com> | 2002-01-07 22:13:25 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2002-01-07 22:13:25 +0100 |
commit | 2e9513841e7b1614d5bcde97e7af166481728296 (patch) | |
tree | aa99d84096fc4acf3768871bf9b897031e77910b /gcc/simplify-rtx.c | |
parent | 15eb1e433c13bfce36e4b8ad4a4a51c9ba24d4f9 (diff) | |
download | gcc-2e9513841e7b1614d5bcde97e7af166481728296.zip gcc-2e9513841e7b1614d5bcde97e7af166481728296.tar.gz gcc-2e9513841e7b1614d5bcde97e7af166481728296.tar.bz2 |
simplify-rtx.c (simplify_plus_minus): Bump n_ops for NOT.
* simplify-rtx.c (simplify_plus_minus): Bump n_ops for NOT.
Don't allow -1 - x -> ~x simplifications in the first pass.
* gcc.c-torture/execute/20020107-1.c: New test.
From-SVN: r48614
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r-- | gcc/simplify-rtx.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index 84209cc..84a9ce9 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -1800,7 +1800,7 @@ simplify_plus_minus (code, mode, op0, op1) if (n_ops != 7) { ops[n_ops].op = constm1_rtx; - ops[n_ops].neg = this_neg; + ops[n_ops++].neg = this_neg; ops[i].op = XEXP (this_op, 0); ops[i].neg = !this_neg; changed = 1; @@ -1865,7 +1865,13 @@ simplify_plus_minus (code, mode, op0, op1) && ! (GET_CODE (tem) == CONST && GET_CODE (XEXP (tem, 0)) == ncode && XEXP (XEXP (tem, 0), 0) == lhs - && XEXP (XEXP (tem, 0), 1) == rhs)) + && XEXP (XEXP (tem, 0), 1) == rhs) + /* Don't allow -x + -1 -> ~x simplifications in the + first pass. This allows us the chance to combine + the -1 with other constants. */ + && ! (first + && GET_CODE (tem) == NOT + && XEXP (tem, 0) == rhs)) { lneg &= rneg; if (GET_CODE (tem) == NEG) |