]> gcc.gnu.org Git - gcc.git/commit
bswap: Fix up bswap_view_convert handling [PR102141]
authorJakub Jelinek <jakub@redhat.com>
Wed, 1 Sep 2021 10:06:25 +0000 (12:06 +0200)
committerJakub Jelinek <jakub@redhat.com>
Wed, 1 Sep 2021 10:06:25 +0000 (12:06 +0200)
commit45ff12512e568089a4c7b85b5322ab8019723cd9
tree00ada361aa22b887d2ac8591a4608a8c303047a5
parente6bd9c42b0ad0cc4a615135612599adb829f2d9c
bswap: Fix up bswap_view_convert handling [PR102141]

bswap_view_convert is used twice in spots where gsi_insert_before is the
right thing, but in the last one it wants to insert preparation stmts
for the VIEW_CONVERT_EXPR emitted with gsi_insert_after, where at the
gsi we still need to insert bswap_stmt and maybe mask_stmt whose lhs
the preparation stmts will use.
So, this patch adds a BEFORE argument to the function and emits the
preparation statements before or after depending on that.

2021-09-01  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/102141
* gimple-ssa-store-merging.c (bswap_view_convert): Add BEFORE
argument.  If false, emit stmts after gsi instead of before, and
with GSI_NEW_STMT.
(bswap_replace): Adjust callers.  When converting output of bswap,
emit VIEW_CONVERT prepratation stmts after a copy of gsi instead
of before it.

* gcc.dg/pr102141.c: New test.
gcc/gimple-ssa-store-merging.c
gcc/testsuite/gcc.dg/pr102141.c [new file with mode: 0644]
This page took 0.069715 seconds and 6 git commands to generate.