gimple-fold: Use ranges to simplify strncat and snprintf
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.
Signed-off-by: Siddhesh Poyarekar <siddhesh@gotplt.org>