Modes on CONST_INTs

Bernd Schmidt bernds@redhat.com
Fri Nov 24 02:06:00 GMT 2000


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.

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.

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).
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.

Then we'll probably have to fix some code that recognizes constants by
the fact that their mode is VOIDmode and other problems likely to show up.

I haven't quite figured out yet what mode should be used for variable shift
counts.

Any comments?


Bernd



More information about the Gcc mailing list