This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: combiner bug and fix
- From: Denis Chertykov <denisc at overta dot ru>
- To: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- Cc: denisc at overta dot ru, gcc-patches at gcc dot gnu dot org
- Date: 30 Jun 2003 19:31:21 +0400
- Subject: Re: combiner bug and fix
- References: <10306262040.AA28761@vlsi1.ultra.nyu.edu>
kenner@vlsi1.ultra.nyu.edu (Richard Kenner) writes:
> Are you suggest to put the fix at top (`say very early') of gen_binary
> ? Or you suggest to put the fix at top of gen_binary and to place of
> my original fix ?
>
> The former. Your patch is not needed.
>
> In former case I don't understand why you want to track rtl so far ?
> (Why we can't reject it by my original fix ?)
>
> Because there are numerous places in the code that handle the CLOBBER
> the way I was suggesting, so it makes it more consistent.
OK.
Stupid question: How can I close the PR 11181 ?
(Bugzilla say that I havn't a right to close it.)
The fix.
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 15:21:18 -0000
***************
*** 1,5 ****
/* Optimize by combining instructions for GNU compiler.
! Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GCC.
--- 1,5 ----
/* Optimize by combining instructions for GNU compiler.
! Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2003,
1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GCC.
*************** 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;