From f0b3f39262c3a2f8e9d268842832ca8c0595c8ec Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Sat, 20 Mar 1999 21:22:08 +0000 Subject: (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 --- gcc/combine.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3