This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: trivial rs6000 fix


Richard Sandiford wrote:

> Not a comment about this patch specifically -- the same construct is
> used all over the place, and it's unlikely that a simple test like this
> would get screwed up.  I just thought I'd point it out because (a) I think
> we need a new function or macro to make these kinds of test and (b) the
> "right thing" is actually two characters shorter:
> 
> #define SMALL_INT(X) ((unsigned HOST_WIDE_INT) INTVAL (X) + 0x8000 < 0x10000)

I agree.

I think we should have a UINTVAL macro so that this would be:

 UINTVAL (X) + 0x8000 < 0x10000

where UINTVAL (X) is (unsigned HOST_WIDE_INT) INTVAL (X)

A patch to add that is pre-approved for Stage 1, or, if anyone can
acutally find a regression because of this, earlier.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]