This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Again combiner bug and fix
- From: Denis Chertykov <denisc at overta dot ru>
- To: gcc-patches at gcc dot gnu dot org
- Cc: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner), denisc at overta dot ru
- Date: Fri, 11 Jul 2003 00:01:23 +0400
- Subject: Again combiner bug and fix
Can anybody approve the following patch. I'm wait from 27-Jun.
gen_binary use simplify-rtx.c:simplify_relational_operation while builds a
new comparison rtl, but simplify-rtx.c isn't use combine convention about
(clobber (const_int 0)).
gen_binary can generate (eq (clobber 0) (clobber 0)) which will be
simplified to (const_int 1).
Is this ok for mainline and 3.3 branch ?
2003-06-30 Denis Chertykov <denisc@overta.ru>
Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* combine.c (gen_binary): Handle the CLOBBER rtx and
don't build a binary operation with it.
Index: combine.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/combine.c,v
retrieving revision 1.364
diff -c -3 -p -r1.364 combine.c
*** combine.c 27 Jun 2003 19:42:24 -0000 1.364
--- combine.c 30 Jun 2003 17:15:53 -0000
*************** gen_binary (enum rtx_code code, enum mac
*** 10170,10175 ****
--- 10170,10180 ----
rtx result;
rtx tem;
+ if (GET_CODE (op0) == CLOBBER)
+ return op0;
+ else if (GET_CODE (op1) == CLOBBER)
+ return op1;
+
if (GET_RTX_CLASS (code) == 'c'
&& swap_commutative_operands_p (op0, op1))
tem = op0, op0 = op1, op1 = tem;