Commit 18eb304e by Jeff Law Committed by Jeff Law

re PR tree-optimization/79578 (Unnecessary instructions in generated code)

	PR tree-optimization/79578
	* tree-ssa-dse.c (clear_bytes_written_by): Use operand_equal_p
	to compare base operands.

	PR tree-optimization/79578
	* g++.dg/tree-ssa/ssa-dse-3.C: New test.

From-SVN: r245675
parent 680ed106
2017-02-22 Jeff Law <law@redhat.com>
PR tree-optimization/79578
* tree-ssa-dse.c (clear_bytes_written_by): Use operand_equal_p
to compare base operands.
2017-02-22 Segher Boessenkool <segher@kernel.crashing.org>
PR target/79211
......
2017-02-22 Jeff Law <law@redhat.com>
PR tree-optimization/79578
* g++.dg/tree-ssa/ssa-dse-3.C: New test.
2017-02-22 Sameera Deshpande <sameera.deshpande@imgtec.com>
* gcc.target/mips/msa-fp-cc.c: New test.
......
/* { dg-do compile } */
/* { dg-options "-std=c++14 -O3 -fdump-tree-dse1-details" } */
#include <new>
#include <cstdint>
struct A
{
std::uint16_t a, b;
};
A* f(char* b) __attribute__((noinline));
A* f(char* b) {
auto a = new(b) A{};
a->a = 1;
a->b = 2;
return a;
}
int main() {
char b[sizeof(A)] alignas(A);
f(b);
}
/* { dg-final { scan-tree-dump "Deleted dead store: " "dse1" } } */
......@@ -176,7 +176,7 @@ clear_bytes_written_by (sbitmap live_bytes, gimple *stmt, ao_ref *ref)
/* Verify we have the same base memory address, the write
has a known size and overlaps with REF. */
if (valid_ao_ref_for_dse (&write)
&& write.base == ref->base
&& operand_equal_p (write.base, ref->base, 0)
&& write.size == write.max_size
&& ((write.offset < ref->offset
&& write.offset + write.size > ref->offset)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment