[Bug middle-end/126622] New: wide_int_to_tree vs build_int_cst (and build_int_cstu) vs build_int_cst_type

"pinskia at gcc dot gnu.org via Gcc-bugs" <[email protected]> Mon, 03 Aug 2026 20:07:40 +0000
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D126622

            Bug ID: 126622
           Summary: wide_int_to_tree vs build_int_cst (and build_int_cstu)
                    vs build_int_cst_type
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Keywords: internal-improvement
          Severity: enhancement
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

There are 3 different APIs that do something similar but not exactly.
build_int_cst is only different from build_int_cst_type is that build_int_c=
st
accepts a NULL type and uses integer_type_node then.=20


r0-61393-g8b11a64cd99d94 added build_int_cst_type .

This has been considered legacy since for ever (since at least
r0-78311-g7fb41a42a9490e).


r0-78318-g2b60792f2b31e4 consolidated build_int_cst_type and build_int_cst =
to
use the same code.

And then wide_int was added. Which gave rise to wide_int_to_tree.
build_int_cst_type/build_int_cst was still only HOST_WIDE_INT (or rather
int64_t).

We need a much simplier API than the current sets to handle all of this.=