diff options
author | Jeff Law <law@redhat.com> | 2017-01-05 00:38:48 -0700 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2017-01-05 00:38:48 -0700 |
commit | d80c6d02fdf0c37596e51392ade43414a350373a (patch) | |
tree | 8e37be87c8ec04e67bbf7f825c453fd039b46d57 /gcc/ifcvt.c | |
parent | 0f9cf7ff836bbc7d4f68e47918c878983c08e386 (diff) | |
download | gcc-d80c6d02fdf0c37596e51392ade43414a350373a.zip gcc-d80c6d02fdf0c37596e51392ade43414a350373a.tar.gz gcc-d80c6d02fdf0c37596e51392ade43414a350373a.tar.bz2 |
re PR rtl-optimization/78812 (Wrong code generation due to hoisting memory load across function call)
PR tree-optimizatin/78812
* rtl.h (contains_mem_rtx_p): Prototype.
* ifcvt.c (containts_mem_rtx_p): Move from here to...
* rtlanal.c (contains_mem_rtx_p): Here and remvoe static linkage.
* gcse.c (prune_expressions): Use contains_mem_rtx_p to discover
and prune MEMs that are not at the toplevel of a SET_SRC rtx. Look
through ZERO_EXTEND and SIGN_EXTEND when trying to avoid pruning
MEMs.
PR tree-optimization/78812
* g++.dg/torture/pr78812.C: New test.
From-SVN: r244093
Diffstat (limited to 'gcc/ifcvt.c')
-rw-r--r-- | gcc/ifcvt.c | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c index 56c785e..68c1a1d 100644 --- a/gcc/ifcvt.c +++ b/gcc/ifcvt.c @@ -3010,19 +3010,6 @@ noce_operand_ok (const_rtx op) return ! may_trap_p (op); } -/* Return true if X contains a MEM subrtx. */ - -static bool -contains_mem_rtx_p (rtx x) -{ - subrtx_iterator::array_type array; - FOR_EACH_SUBRTX (iter, array, x, ALL) - if (MEM_P (*iter)) - return true; - - return false; -} - /* Return true iff basic block TEST_BB is valid for noce if-conversion. The condition used in this if-conversion is in COND. In practice, check that TEST_BB ends with a single set |