Trunk has this:
| /* Create an INT_CST node with a CST value zero extended. */
|
| static inline tree
| build_int_cstu (tree type, unsigned HOST_WIDE_INT cst)
| {
| return double_int_to_tree (type, uhwi_to_double_int (cst));
| }
But the comment is misleading because of:
| /* Constructs tree in type TYPE from with value given by CST. Signedness
| of CST is assumed to be the same as the signedness of TYPE. */
|
| tree
| double_int_to_tree (tree type, double_int cst)
| {
| /* Size types *are* sign extended. */
| bool sign_extended_type = (!TYPE_UNSIGNED (type)
| || (TREE_CODE (type) == INTEGER_TYPE
| && TYPE_IS_SIZETYPE (type)));
|
| cst = double_int_ext (cst, TYPE_PRECISION (type), !sign_extended_type);
|
| return build_int_cst_wide (type, cst.low, cst.high);
| }
So for size types, build_int_cstu does not peform zero extension, but
sign extension.
If I don't want sign extension, what function should I use instead?
Should I just call build_int_cst_wide directly?
And is HOST_WIDE_INT guaraunteed to be able to hold 64 bits? I recall
a discussion were it was said that cross-builds from hosts with narrow
HOST_WIDE_INT to 64 bit targets weren't supported.