aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-object-size.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2021-01-07 09:57:40 +0100
committerJakub Jelinek <jakub@redhat.com>2021-01-07 09:57:40 +0100
commitd02a8b63e5aef49ab6973c64a2225236895763a1 (patch)
tree870dab1a33b91c1c4108ff01508567926a465419 /gcc/tree-object-size.c
parent1b5669752426d225b0088d57d1d2fffba9625032 (diff)
downloadgcc-d02a8b63e5aef49ab6973c64a2225236895763a1.zip
gcc-d02a8b63e5aef49ab6973c64a2225236895763a1.tar.gz
gcc-d02a8b63e5aef49ab6973c64a2225236895763a1.tar.bz2
bswap: Fix up recent vector CONSTRUCTOR optimization [PR98568]
As the testcase shows, bswap can match even byte-swapping or indentity from low part of some wider SSA_NAME. For bswap replacement other than for vector CONSTRUCTOR the code has been using NOP_EXPR casts if the types weren't compatible, but for vectors we need to use VIEW_CONVERT_EXPR. The problem with the latter is that we require that it has the same size, which isn't guaranteed, so this patch in those cases first adds a narrowing NOP_EXPR cast and only afterwards does a VIEW_CONVERT_EXPR. 2021-01-07 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/98568 * gimple-ssa-store-merging.c (bswap_view_convert): New function. (bswap_replace): Use it. * g++.dg/torture/pr98568.C: New test.
Diffstat (limited to 'gcc/tree-object-size.c')
0 files changed, 0 insertions, 0 deletions