]> git.ipfire.org Git - thirdparty/gcc.git/commit
-finline-stringops: allow expansion into edges [PR113002]
authorAlexandre Oliva <oliva@adacore.com>
Wed, 20 Dec 2023 01:17:42 +0000 (22:17 -0300)
committerAlexandre Oliva <oliva@gnu.org>
Wed, 20 Dec 2023 08:18:15 +0000 (05:18 -0300)
commit672db38c6f0723ca57fe8ff4c43422341e7fb857
tree154ca1933e75600312873fabd52fc27b500fdb82
parent438bf6ade4b089d592ec481086cde664a1ea1f3d
-finline-stringops: allow expansion into edges [PR113002]

Builtin expanders for memset and memcpy may involve conditionals and
loops, but their sequences may be end up emitted in edges.  Alas,
commit_one_edge_insertion rejects sequences that end with a jump, a
requirement that makes sense for insertions after expand, but not so
much during expand.

During expand, jumps may appear in the middle of the insert sequence
as much as in the end, and it's only after committing edge insertions
out of PHI nodes that we go through the entire function splitting
blocks where needed, so relax the assert in commit_one_edge_insertion
so that jumps are accepted during expand even at the end of the
sequence.

for  gcc/ChangeLog

PR rtl-optimization/113002
* cfgrtl.cc (commit_one_edge_insertion): Tolerate jumps in the
inserted sequence during expand.

for  gcc/testsuite/ChangeLog

PR rtl-optimization/113002
* gcc.dg/vect/pr113002.c: New.
gcc/cfgrtl.cc
gcc/testsuite/gcc.dg/vect/pr113002.c [new file with mode: 0644]