On Mon, May 4, 2026 at 7:24 PM Andrew MacLeod <[email protected]> wrote:
>
> get_maxval_strlen () in gimple-fold.cc creates a bitmap for
> get_range_strlen to use.  If an integer constant is passed in, it
> creates a a lot of overhead for no real reason.
>
> I also have upcoming uses of it which, although I don't have it in front
> of me, also wasn't working properly for the constant path.
>
> This patch simply checks for the constant condition up front, and
> returns the value which would have been returned had the
> get_range_strlen been called. I note that +INF is a special case and is
> suppose to return NULL_TREE, which is what this patch also does.
>
> Bootstrapped on x86_64-pc-linux-gnu with no regressions. Is this OK for
> trunk?

I believe for SRK_INT_VALUE, aka "Determine the integer value of the
argument (not string length)."
you can simply return arg if INTEGER_CST, without checking it's sign
or against maxval.

OK with that change.

Richard.

>
> Andrew
>

Reply via email to