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


Richard Kenner wrote:
If the idea is to avoid having to do a conversion of an integer_type_node
to another type (and hence waste node), why doesn't it call force_fit_type
to ensure that the constant doesn't overflow the requested type?
it is supposed to be a drop in replacement for
	t = build_int_2 (x, y);
	TREE_TYPE (t) = z;
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.

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

nathan

--
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk



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