diff options
author | Jakub Jelinek <jakub@redhat.com> | 2012-02-13 11:37:35 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2012-02-13 11:37:35 +0100 |
commit | 205ec405fc77c42a21ba12927a23985bf7176e58 (patch) | |
tree | ed8769515c0c91e62b83378f6bd7d0b723a42c68 /gcc/expr.c | |
parent | 5ac5049603ea4650a07166ee09a6b3c2ae0a01d8 (diff) | |
download | gcc-205ec405fc77c42a21ba12927a23985bf7176e58.zip gcc-205ec405fc77c42a21ba12927a23985bf7176e58.tar.gz gcc-205ec405fc77c42a21ba12927a23985bf7176e58.tar.bz2 |
re PR middle-end/52209 (wrong code at -O0)
PR middle-end/52209
* expr.c (expand_expr_real_2) <case BIT_NOT_EXPR>: Only expand using
XOR for reduce_bit_field if type is unsigned.
* gcc.c-torture/execute/pr52209.c: New test.
From-SVN: r184151
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -8600,8 +8600,9 @@ expand_expr_real_2 (sepops ops, rtx target, enum machine_mode tmode, if (modifier == EXPAND_STACK_PARM) target = 0; /* In case we have to reduce the result to bitfield precision - expand this as XOR with a proper constant instead. */ - if (reduce_bit_field) + for unsigned bitfield expand this as XOR with a proper constant + instead. */ + if (reduce_bit_field && TYPE_UNSIGNED (type)) temp = expand_binop (mode, xor_optab, op0, immed_double_int_const (double_int_mask (TYPE_PRECISION (type)), mode), |