diff options
author | Siddhesh Poyarekar <siddhesh@gotplt.org> | 2021-11-15 23:03:15 +0530 |
---|---|---|
committer | Siddhesh Poyarekar <siddhesh@gotplt.org> | 2021-11-16 04:20:46 +0530 |
commit | 323026c7dfe23e1093e80f7db5f4851d1a867b62 (patch) | |
tree | 50e43bf3d1fb56115469cc2cf6fbb859015267a3 /gcc/c-family/c-cppbuiltin.c | |
parent | cea4dab861bae6536dd5655a42d73f2c17f655f7 (diff) | |
download | gcc-323026c7dfe23e1093e80f7db5f4851d1a867b62.zip gcc-323026c7dfe23e1093e80f7db5f4851d1a867b62.tar.gz gcc-323026c7dfe23e1093e80f7db5f4851d1a867b62.tar.bz2 |
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>
Diffstat (limited to 'gcc/c-family/c-cppbuiltin.c')
0 files changed, 0 insertions, 0 deletions