re PR tree-optimization/81396 (Optimization of reading Little-Endian 64-bit number...
authorJakub Jelinek <jakub@redhat.com>
Mon, 17 Jul 2017 08:14:16 +0000 (10:14 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 17 Jul 2017 08:14:16 +0000 (10:14 +0200)
commit1f1e8aed3afc08e9d70bba9110e289f7fa329453
treece61c2221126093bbe0151b30cada1ee8d593428
parented9091b270721c399112c74eb15b7fc27ef127db
re PR tree-optimization/81396 (Optimization of reading Little-Endian 64-bit number with portable code has a regression)

PR tree-optimization/81396
* tree-ssa-math-opts.c (struct symbolic_number): Add n_ops field.
(init_symbolic_number): Initialize it to 1.
(perform_symbolic_merge): Add n_ops from both operands into the new
n_ops.
(find_bswap_or_nop): Don't consider n->n == cmpnop computations
without base_addr as useless if they need more than one operation.
(bswap_replace): Handle !bswap case for NULL base_addr.

* gcc.dg/tree-ssa/pr81396.c: New test.

From-SVN: r250257
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/pr81396.c [new file with mode: 0644]
gcc/tree-ssa-math-opts.c