This is the mail archive of the gcc@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: Question on build_int_cst


    it is supposed to be a drop in replacement for
    	t = build_int_2 (x, y);
	TREE_TYPE (t) = z;

I didn't think we actually did that due to the risk of T being shared.
I thought it was a replacement for
	convert (t, build_int_2 (x, y))

    AFAICT most cases of use correctly condition x & y, so the overhead of
    force_fit_type would be bad. Use,
	t = force_fit_type (build_int_cst (z, x, y), 0, 0, 0);
    if you need to condition the range.

That's fine, except that it should be "false, false, false".  :-)

    The idea of build_int_cst is to allow sharing of the int_csts so
    generated.

Have you thought of checking for a sizetype and calling the corresponding
function that does share in that case?


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