aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2003-07-04 16:00:19 -0600
committerJeff Law <law@gcc.gnu.org>2003-07-04 16:00:19 -0600
commit60cd4daea2a58e4be6f9c91cbca66f63a033182f (patch)
tree3a9bd21e507ddfde6621f5d3a0295642f5e56dd1 /gcc/expr.c
parent5e14ae7e269c0ae1206b62237f7b6cbdd68f6fec (diff)
downloadgcc-60cd4daea2a58e4be6f9c91cbca66f63a033182f.zip
gcc-60cd4daea2a58e4be6f9c91cbca66f63a033182f.tar.gz
gcc-60cd4daea2a58e4be6f9c91cbca66f63a033182f.tar.bz2
expr.c (do_store_flag): Pass in the correct result type when calling fold_single_bit_test.
* expr.c (do_store_flag): Pass in the correct result type when calling fold_single_bit_test. * fold-const.c (fold_single_bit_test): Use result_type for the result when folding a sign bit test. From-SVN: r68940
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index f735f95..56d733f 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -9998,9 +9998,12 @@ do_store_flag (tree exp, rtx target, enum machine_mode mode, int only_cheap)
if ((code == NE || code == EQ)
&& TREE_CODE (arg0) == BIT_AND_EXPR && integer_zerop (arg1)
&& integer_pow2p (TREE_OPERAND (arg0, 1)))
- return expand_expr (fold_single_bit_test (code == NE ? NE_EXPR : EQ_EXPR,
- arg0, arg1, type),
- target, VOIDmode, EXPAND_NORMAL);
+ {
+ tree type = (*lang_hooks.types.type_for_mode) (mode, unsignedp);
+ return expand_expr (fold_single_bit_test (code == NE ? NE_EXPR : EQ_EXPR,
+ arg0, arg1, type),
+ target, VOIDmode, EXPAND_NORMAL);
+ }
/* Now see if we are likely to be able to do this. Return if not. */
if (! can_compare_p (code, operand_mode, ccp_store_flag))