[PATCH] Re: Checking out PR4483 (constant overflow on PPC, problems compiling Linux kernel)

Geert Bosch bosch@gnat.com
Sat Dec 1 19:43:00 GMT 2001


On Saturday, December 1, 2001, at 07:46 , Richard Kenner wrote:
> There indeed would be some things simplified by having CONST_INTs (and
> integral CONST_DOUBLEs) have modes, but there are other things that
> might get more complex and I'm not sure I agree that modes are the
> right approach, but I'm also not strongly against it.
>

One of the reasons against it may be that *operations* need to know the
mode of their results. In this case, we have a PLUS operation in SI 
mode.
The compiler should know that information. What the mode of the operand
is does not really matter here. We have two mathematical quantities 
x and y
and we want to do a certain operation on them. This operation can
conceptually be separated in a mathematically exact part (the familiar
notion of +) and a rounding/truncating step. This is similar to
floating-point arithmetic.

As long as a constant is exact, it really doesn't make a lot of sense
to talk about its mode.

   -Geert



More information about the Gcc-patches mailing list