[PATCH] simplify get_range_strlen interface

Martin Sebor msebor@gmail.com
Mon Nov 15 22:05:49 GMT 2021


The deeply nested PHI handling in get_range_strlen_dynamic makes
the code bigger and harder to follow than it would be if done in
its own function.  The attached patch does that.

In addition, the get_range_strlen family of functions use a bitmap
to avoid infinite recursion.  Rather than dynamically allocating
and freeing it on demand the attached patch simplifies the code
by using an instance of auto_bitmap.  This avoids the risk of
neglecting to deallocate the bitmap.

Tested on x86_64-linux.

Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc-get_range_strlen_dynamic.diff
Type: text/x-patch
Size: 10894 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20211115/c18bb44c/attachment-0001.bin>


More information about the Gcc-patches mailing list