This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Replace #ifdef HAVE_cc0 with CC0_P
- From: Kazu Hirata <kazu at cs dot umass dot edu>
- To: roger at www dot eyesopen dot com
- Cc: gcc-patches at gcc dot gnu dot org, rth at redhat dot com
- Date: Sun, 02 Feb 2003 16:33:45 -0500 (EST)
- Subject: Re: [PATCH] Replace #ifdef HAVE_cc0 with CC0_P
- References: <Pine.LNX.4.44.0302021312350.17363-100000@www.eyesopen.com>
Hi Roger,
> > The only users of CC0_P are combine.c and gcse.c.
>
> Not for long :> I've been sitting on the following patch to clean-up
> some of the conditional compilation in GCC, using the new CC0_P macro.
I like your clean-up a lot.
I just discovered that my original patch of including insn-config.h
from rtl.h creates circular dependencies. genconfig needs
insn-config.h, and vice versa. (gmake was kind enough to break the
circle, so I didn't notice until I looked at a build log.)
Here is one dirty (dirtiest?) solution that works without creating
dependency problem.
Kazu Hirata
2003-02-02 Kazu Hirata <kazu@cs.umass.edu>
* genconfig.c (main): Generate CC0_P.
* rtl.h (CC0_P): Remove.
Index: genconfig.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/genconfig.c,v
retrieving revision 1.48
diff -u -r1.48 genconfig.c
--- genconfig.c 16 Dec 2002 18:19:33 -0000 1.48
+++ genconfig.c 2 Feb 2003 21:21:27 -0000
@@ -342,7 +342,14 @@
printf ("#endif\n");
if (have_cc0_flag)
- printf ("#define HAVE_cc0 1\n");
+ {
+ printf ("#define HAVE_cc0 1\n");
+ printf ("#define CC0_P(X) ((X) == cc0_rtx)\n");
+ }
+ else
+ {
+ printf ("#define CC0_P(X) 0\n");
+ }
if (have_cmove_flag)
printf ("#define HAVE_conditional_move 1\n");
Index: rtl.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/rtl.h,v
retrieving revision 1.382
diff -u -r1.382 rtl.h
--- rtl.h 24 Jan 2003 22:45:57 -0000 1.382
+++ rtl.h 2 Feb 2003 21:21:29 -0000
@@ -273,13 +273,6 @@
/* Predicate yielding nonzero iff X is a barrier insn. */
#define BARRIER_P(X) (GET_CODE (X) == BARRIER)
-/* Predicate yielding nonzero iff X is cc0. */
-#ifdef HAVE_cc0
-#define CC0_P(X) ((X) == cc0_rtx)
-#else
-#define CC0_P(X) 0
-#endif
-
/* Predicate yielding nonzero iff X is a data for a jump table. */
#define JUMP_TABLE_DATA_P(INSN) \
(JUMP_P (INSN) && (GET_CODE (PATTERN (INSN)) == ADDR_VEC || \