This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Question on build_int_cst
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: Richard Kenner <kenner at vlsi1 dot ultra dot nyu dot edu>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 18 Aug 2004 09:41:58 +0100
- Subject: Re: Question on build_int_cst
- Organization: CodeSourcery LLC
- References: <10408171858.AA12549@vlsi1.ultra.nyu.edu>
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