diff options
author | Andrew Pinski <quic_apinski@quicinc.com> | 2024-09-06 12:29:26 -0700 |
---|---|---|
committer | Andrew Pinski <quic_apinski@quicinc.com> | 2024-09-09 01:12:52 -0700 |
commit | 2067df800df930dd13aa20a826373bb27cfdd420 (patch) | |
tree | 558ce9fc7c427bcab9ed9ba131f035f78ae44fc0 /gcc/fortran/error.cc | |
parent | 924855daa204b4821057313cad44898445824e11 (diff) | |
download | gcc-2067df800df930dd13aa20a826373bb27cfdd420.zip gcc-2067df800df930dd13aa20a826373bb27cfdd420.tar.gz gcc-2067df800df930dd13aa20a826373bb27cfdd420.tar.bz2 |
gimple-fold: Move optimizing memcpy to memset to fold_stmt from fab
I noticed this folding inside fab could be done else where and could
even improve inlining decisions and a few other things so let's
move it to fold_stmt.
It also fixes PR 116601 because places which call fold_stmt already
have to deal with the stmt becoming a non-throw statement.
For the fix for PR 116601 on the branches should be the original patch
rather than a backport of this one.
Bootstrapped and tested on x86_64-linux-gnu.
PR tree-optimization/116601
gcc/ChangeLog:
* gimple-fold.cc (optimize_memcpy_to_memset): Move
from tree-ssa-ccp.cc and rename. Also return true
if the optimization happened.
(gimple_fold_builtin_memory_op): Call
optimize_memcpy_to_memset.
(fold_stmt_1): Call optimize_memcpy_to_memset for
load/store copies.
* tree-ssa-ccp.cc (optimize_memcpy): Delete.
(pass_fold_builtins::execute): Remove code that
calls optimize_memcpy.
gcc/testsuite/ChangeLog:
* gcc.dg/pr78408-1.c: Adjust dump scan to match where
the optimization now happens.
* g++.dg/torture/except-2.C: New test.
Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
Diffstat (limited to 'gcc/fortran/error.cc')
0 files changed, 0 insertions, 0 deletions