This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Question on build_int_cst
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- To: nathan at codesourcery dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 18 Aug 04 07:54:07 EDT
- Subject: 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?