This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
combiner bug
- To: kenner at vlsi1 dot ultra dot nyu dot edu
- Subject: combiner bug
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Wed, 01 Dec 1999 00:55:46 -0700
- Cc: gcc-patches at gcc dot gnu dot org
- Reply-To: law at cygnus dot com
I'm not real familiar with this code, but this might be the fix. Basically
we can't assume the result of a (eq/ne (blah) (const_int 0)) will have
the value 0 or 1. It will have the value 0 or STORE_FLAG_VALUE (aka
const_true_rtx).
Your input on this would be greatly appreciated.
* combine.c (if_then_else_cond): Use const_true_rtx instead of
const1_rtx for return values in EQ/NE comparison against (const_int 0)
case.
Index: combine.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/combine.c,v
retrieving revision 1.95
diff -c -3 -p -r1.95 combine.c
*** combine.c 1999/11/30 23:19:06 1.95
--- combine.c 1999/12/01 07:56:39
*************** if_then_else_cond (x, ptrue, pfalse)
*** 7037,7044 ****
if ((code == NE || code == EQ)
&& GET_CODE (XEXP (x, 1)) == CONST_INT && INTVAL (XEXP (x, 1)) == 0)
{
! *ptrue = (code == NE) ? const1_rtx : const0_rtx;
! *pfalse = (code == NE) ? const0_rtx : const1_rtx;
return XEXP (x, 0);
}
--- 7037,7044 ----
if ((code == NE || code == EQ)
&& GET_CODE (XEXP (x, 1)) == CONST_INT && INTVAL (XEXP (x, 1)) == 0)
{
! *ptrue = (code == NE) ? const_true_rtx : const0_rtx;
! *pfalse = (code == NE) ? const0_rtx : const_true_rtx;
return XEXP (x, 0);
}