diff options
author | Siddhesh Poyarekar <siddhesh@gotplt.org> | 2021-11-15 23:03:13 +0530 |
---|---|---|
committer | Siddhesh Poyarekar <siddhesh@gotplt.org> | 2021-11-16 04:19:51 +0530 |
commit | d1753b4be981fcb176f56b6ed45f7dbe1177d641 (patch) | |
tree | de2bb231db90865a3451fb4bcd592e51d86f9ccf /gcc/omp-expand.c | |
parent | 4c19122bf5afa5cb479fd9445f0c591c52add09b (diff) | |
download | gcc-d1753b4be981fcb176f56b6ed45f7dbe1177d641.zip gcc-d1753b4be981fcb176f56b6ed45f7dbe1177d641.tar.gz gcc-d1753b4be981fcb176f56b6ed45f7dbe1177d641.tar.bz2 |
gimple-fold: Transform stp*cpy_chk to str*cpy directly
Avoid going through another folding cycle and use the ignore flag to
directly transform BUILT_IN_STPCPY_CHK to BUILT_IN_STRCPY when set,
likewise for BUILT_IN_STPNCPY_CHK to BUILT_IN_STPNCPY.
Dump the transformation in dump_file so that we can verify in tests that
the direct transformation actually happened.
gcc/ChangeLog:
* gimple-fold.c (dump_transformation): New function.
(gimple_fold_builtin_stxcpy_chk,
gimple_fold_builtin_stxncpy_chk): Use it. Simplify to
BUILT_IN_STRNCPY if return value is not used.
gcc/testsuite/ChangeLog:
* gcc.dg/fold-stringops-1.c: New test.
Signed-off-by: Siddhesh Poyarekar <siddhesh@gotplt.org>
Diffstat (limited to 'gcc/omp-expand.c')
0 files changed, 0 insertions, 0 deletions