summaryrefslogtreecommitdiffstats
path: root/gcc
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2003-07-04 22:00:19 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2003-07-04 22:00:19 +0000
commit76c3b8b7b1054d3fc9ddae7ba863827d349ac802 (patch)
tree3a9bd21e507ddfde6621f5d3a0295642f5e56dd1 /gcc
parent57f4dee32f0ac6ef136b72f8f5f59e7dfd79c3fa (diff)
downloadppe42-gcc-76c3b8b7b1054d3fc9ddae7ba863827d349ac802.tar.gz
ppe42-gcc-76c3b8b7b1054d3fc9ddae7ba863827d349ac802.zip
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@68940 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/expr.c9
-rw-r--r--gcc/fold-const.c2
3 files changed, 14 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a4c7909c02d..970b60a3271 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2003-07-04 Jeff Law <law@redhat.com>
+
+ * 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.
+
2003-07-04 Neil Booth <neil@daikokuya.co.uk>
* opts.c (common_handle_options): Negate sense of -falign- switches.
diff --git a/gcc/expr.c b/gcc/expr.c
index f735f95515c..56d733f2d0f 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))
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 0524e1dc16e..64a30f4b825 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -4825,7 +4825,7 @@ fold_single_bit_test (code, arg0, arg1, result_type)
if (arg00 != NULL_TREE)
{
tree stype = (*lang_hooks.types.signed_type) (TREE_TYPE (arg00));
- return fold (build (code == EQ_EXPR ? GE_EXPR : LT_EXPR, type,
+ return fold (build (code == EQ_EXPR ? GE_EXPR : LT_EXPR, result_type,
convert (stype, arg00),
convert (stype, integer_zero_node)));
}
OpenPOWER on IntegriCloud