+2018-01-26 Richard Biener <rguenther@suse.de>
+
+ PR rtl-optimization/84003
+ * dse.c (record_store): Only record redundant stores when
+ the earlier store aliases at least all accesses the later one does.
+
2018-01-26 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/83985
&& known_subrange_p (offset, width,
s_info->offset, s_info->width)
&& all_positions_needed_p (s_info, offset - s_info->offset,
- width))
+ width)
+ /* We can only remove the later store if the earlier aliases
+ at least all accesses the later one. */
+ && (MEM_ALIAS_SET (mem) == MEM_ALIAS_SET (s_info->mem)
+ || alias_set_subset_of (MEM_ALIAS_SET (mem),
+ MEM_ALIAS_SET (s_info->mem))))
{
if (GET_MODE (mem) == BLKmode)
{
+2018-01-26 Richard Biener <rguenther@suse.de>
+
+ PR rtl-optimization/84003
+ * g++.dg/torture/pr77745.C: Mark foo noinline to trigger
+ latent bug in DSE if NOINLINE is appropriately defined.
+ * g++.dg/torture/pr77745-2.C: New testcase including pr77745.C
+ and defining NOINLINE.
+
2018-01-26 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* gcc.target/aarch64/advsimd-intrinsics/vld1x2.c: Make float64
--- /dev/null
+// { dg-do run }
+
+#define NOINLINE __attribute__((noinline))
+#include "pr77745.C"
// { dg-do run }
+#ifndef NOINLINE
+#define NOINLINE /* */
+#endif
+
inline void* operator new(__SIZE_TYPE__, void* __p) noexcept { return __p; }
-long foo(char *c1, char *c2)
+long NOINLINE foo(char *c1, char *c2)
{
long *p1 = new (c1) long;
*p1 = 100;