[PATCH v2 3/3] gimple-fold: Use ranges to simplify strncat and snprintf

Jeff Law jeffreyalaw@gmail.com
Mon Nov 15 19:38:12 GMT 2021



On 11/15/2021 10:33 AM, Siddhesh Poyarekar wrote:
> Use ranges for lengths and object sizes in strncat and snprintf to
> determine if they can be transformed into simpler operations.
>
> gcc/ChangeLog:
>
> 	* gimple-fold.c (gimple_fold_builtin_strncat): Use ranges to
> 	determine if it is safe to transform to strcat.
> 	(gimple_fold_builtin_snprintf): Likewise.
>
> gcc/testsuite/ChangeLog:
>
> 	* gcc.dg/fold-stringops-2.c: Define size_t.
> 	(safe1): Adjust.
> 	(safe4): New test.
> 	* gcc.dg/fold-stringops-3.c: New test.
OK
jeff



More information about the Gcc-patches mailing list