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: Reorder some tree codes


Kaveh R. Ghazi wrote:
> Zack Weinberg wrote: > > Reducing the width of IN_RANGE from unsigned HOST_WIDE_INT to unsigned
> > makes me nervous. Why did you need to do that?
> > > That is suspicious. I originally thought the only use was in
> java/lex.c, but now I see that it is used in the back end as
> well. Nathan?
> Mark Mitchell


When I originally added IN_RANGE() a few years ago, it was for curing
some warnings, both "signed/unsigned" and "unsigned >= 0 always true".

The reason it was needed was because some target macros accepting
parameters received a mix of signed, unsigned, HOST_WIDE_INT and
unsigned HOST_WIDE_INT arguments at different points all over the
source base.  These arguments were used in comparisons with sign
mismatches or against zero making it impossible to fix at each call
site for all targets.

Using IN_RANGE, and using the widest type was the only safe solution
for a general purpose macro.  So I don't think we should narrow it
without considering where it's used.

I agree. In the short term, Nathan can always revert his change to IN_RANGE, and then adjust the tree-code macros to use <= and >= directly. That's safest.


--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304


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