See updated part 2 of the patch in attachment. Part 1 is unchanged. New 
ChangeLog are as follows:

*** gcc/ChangeLog ***

2014-04-23  Thomas Preud'homme  <thomas.preudho...@arm.com>

        PR tree-optimization/54733
        * tree-ssa-math-opts.c (find_bswap_load): New.
        (find_bswap_1): Add support for memory source.
        (find_bswap): Likewise.
        (execute_optimize_bswap): Likewise.
        * expr.c (get_inner_reference): Renamed to ...
        (get_inner_reference_1): This. Also add a parameter to control whether
        a MEM_REF should be split into base + offset.
        (get_inner_reference): New wrapper around get_inner_reference_1 for
        compatibility.
        (get_inner_reference_base): New wrapper around get_inner_reference_1
        to access its new facet.
        * tree.h (get_inner_reference_base): Declare.


*** gcc/testsuite/ChangeLog ***

2014-04-23  Thomas Preud'homme  <thomas.preudho...@arm.com>

        PR tree-optimization/54733
        * gcc.dg/optimize-bswapdi-3.c: New test to check extension of bswap
        optimization to support memory sources.
        * gcc.dg/optimize-bswaphi-1.c: Likewise.
        * gcc.dg/optimize-bswapsi-2.c: Likewise.
        * gcc.c-torture/execute/bswap-2.c: Likewise.

Bootstrapped on x86_64-linux-gnu with no testsuite regression. Also did a 
arm-none-eabi cross build with no regression after running testsuite via qemu

Best regards,

Thomas

Attachment: gcc32rm-84.4.0.part2.diff
Description: Binary data

Reply via email to