This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Modes on CONST_INTs
- To: Bernd Schmidt <bernds at redhat dot com>
- Subject: Re: Modes on CONST_INTs
- From: Jeffrey A Law <law at redhat dot com>
- Date: Mon, 27 Nov 2000 15:29:43 -0700
- cc: gcc at gcc dot gnu dot org
- Reply-To: law at redhat dot com
In message <Pine.LNX.4.21.0011240956520.12759-100000@host117.cygnus>you write
:
> It seems that every now and then, we run into bugs involving a lack of mode
> information on CONST_INTs. So far everyone I've asked has agreed that we
> really should have a mode for constants, but no one ever bothered because
> the change is going to be huge.
Yes.
> Even if the change is going to be huge, I don't see how it can be any more
> painful than the recurring problems we have because of the lack of mode
> information. So, I'm looking for viable ways to gradually transform the
> compiler towards using modes on constants.
OK. Personally I feel the change (as a whole) is too big for GCC 3.0, but if
there are safe stepping stones we can put in now we can go forward them them.
> Here's what I have in mind so far:
> 1. Create a new macro GENMINT (MODE, INTVAL). This macro will at first
> ignore the MODE argument.
> Replace all uses of GEN_INT with GENMINT. Once done, remove the old
> GEN_INT and rename GENMINT to GEN_INT. (I'm open to suggestions for
> a better name than GENMINT, but it should have 7 characters to avoid
> reformatting madness).
Basically Ok. However GEN_INT is (IMHO) a well-known interface provided
to front & backends. We should either remove it, or keep it, but produce
an error. I don't think we want to add another argument GEN_INT.
> 2. In a similar way, replace uses of const0_rtx etc. with CONST0_RTX(MODE).
> We'll also need a few new macros, e.g. CONSTM1_RTX(MODE) etc.
Similarly. It might even be able to happen independently of #1. In fact,
I generally prefer to write CONST0_RTX(MODE) over const0_rtx already :-)
Note that initially
> I haven't quite figured out yet what mode should be used for variable shift
> counts.
word_mode, unless there is some notable benefit in using a smaller mode.
jeff