[PATCH] simplify get_range_strlen interface

Martin Sebor msebor@gmail.com
Tue Nov 16 16:30:35 GMT 2021


On 11/15/21 3:05 PM, Martin Sebor wrote:
> 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.

I forgot over the weekend that this change also fixes a bug:
PR 102960.

I have committed the fix in r12-5310 along with a test.

Martin

> 
> Tested on x86_64-linux.
> 
> Martin



More information about the Gcc-patches mailing list