aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>1999-03-20 21:22:08 +0000
committerRichard Kenner <kenner@vlsi1.ultra.nyu.edu>1999-03-20 21:22:08 +0000
commitf0b3f39262c3a2f8e9d268842832ca8c0595c8ec (patch)
treec776f0b5cc6db2e605f325591f50648b356da8c7
parent36ef2644ee6bdcf9be56b3af95bc4e9ad9a18c62 (diff)
(simplify_comparison): When making comparison in wider mode, check for
having commuted an AND and a SUBREG. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/premerge-fsf-branch@25873 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/combine.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index 92c66264175..31d2814b6cd 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -1,5 +1,5 @@
/* Optimize by combining instructions for GNU compiler.
- Copyright (C) 1987, 88, 92-97, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1987, 88, 92-98, 1999 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -10257,6 +10257,17 @@ simplify_comparison (code, pop0, pop1)
&& (num_sign_bit_copies (op1, tmode)
> GET_MODE_BITSIZE (tmode) - GET_MODE_BITSIZE (mode))))
{
+ /* If OP0 is an AND and we don't have an AND in MODE either,
+ make a new AND in the proper mode. */
+ if (GET_CODE (op0) == AND
+ && (add_optab->handlers[(int) mode].insn_code
+ == CODE_FOR_nothing))
+ op0 = gen_binary (AND, tmode,
+ gen_lowpart_for_combine (tmode,
+ XEXP (op0, 0)),
+ gen_lowpart_for_combine (tmode,
+ XEXP (op0, 1)));
+
op0 = gen_lowpart_for_combine (tmode, op0);
op1 = gen_lowpart_for_combine (tmode, op1);
break;