diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1993-06-23 07:52:14 -0400 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1993-06-23 07:52:14 -0400 |
commit | c71ebae3c4909d3ccad83bf87a6e36a21744182f (patch) | |
tree | 6e0b77dcc102537b334980e98cfe4d7f0c35377b | |
parent | dd27116b8ff920cea2001d4f6c1dd95c0114d2de (diff) | |
download | gcc-c71ebae3c4909d3ccad83bf87a6e36a21744182f.zip gcc-c71ebae3c4909d3ccad83bf87a6e36a21744182f.tar.gz gcc-c71ebae3c4909d3ccad83bf87a6e36a21744182f.tar.bz2 |
(jump_optimize): Properly make jump into store-flag sequence when...
(jump_optimize): Properly make jump into store-flag sequence when the
jump can't be reversed but the TRUE branch is const0_rtx.
From-SVN: r4715
-rw-r--r-- | gcc/jump.c | 22 |
1 files changed, 17 insertions, 5 deletions
@@ -1,5 +1,5 @@ /* Optimize jump instructions, for GNU compiler. - Copyright (C) 1987, 1988, 1989, 1991, 1992 Free Software Foundation, Inc. + Copyright (C) 1987, 88, 89, 91, 92, 1993 Free Software Foundation, Inc. This file is part of GNU CC. @@ -1155,10 +1155,22 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan) 1, OPTAB_WIDEN); } else if (normalizep != 1) - target = expand_and (uval, target, - (GET_CODE (target) == REG - && ! preserve_subexpressions_p () - ? target : NULL_RTX)); + { + /* We know that either CVAL or UVAL is zero. If + UVAL is zero, negate TARGET and `and' with CVAL. + Otherwise, `and' with UVAL. */ + if (uval == const0_rtx) + { + target = expand_unop (GET_MODE (var), one_cmpl_optab, + target, NULL_RTX, 0); + uval = cval; + } + + target = expand_and (uval, target, + (GET_CODE (target) == REG + && ! preserve_subexpressions_p () + ? target : NULL_RTX)); + } emit_move_insn (var, target); seq = get_insns (); |