build_range_type/build_index_type

Mark Mitchell mark@markmitchell.com
Mon Nov 23 12:39:00 GMT 1998


>>>>> "Jeffrey" == Jeffrey A Law <law@hurl.cygnus.com> writes:

    >> Tue Nov 3 22:36:53 1998 Mark Mitchell <mark@markmitchell.com>
    >> 
    >> * tree.c (build_range_type): Check for highval == -1, and don't
    >> truncate this value.  (build_index_type): Call
    >> build_index_2_type instead of duplicating build_range_type
    >> inline.

    Jeffrey> I don't see the problem.  The functions build_index_type
    Jeffrey> and build_range_type are trying to solve different
    Jeffrey> problems.  The fact that they share a bunch of code is

The problem is that build_index_2_type and build_index_type do subtly
different things, even though the apparent intended semantics is to
have build_index_type be a convenience wrapper which is just like
build_index_2_type, but uses zero for the lower bound.

It would be nice if there were some documentation explaining *why*
build_index_type and build_range_type are handling -1 differently.
But, I'm content to believe you if you think that there's some subtle
reason why one of these keeps it as -1 and the other transforms it to
2^32 - 1. :-)

I'll submit a patch that doesn't change the behavior of
build_index_type or build_range_type, but does make build_index_2_type
behave like build_index_type rather than build_range_type, and which
also breaks out the common code.  OK?

-- 
Mark Mitchell 			mark@markmitchell.com
Mark Mitchell Consulting	http://www.markmitchell.com



More information about the Gcc-patches mailing list