+2018-02-16 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/84190
+ * tree-ssa.c (non_rewritable_mem_ref_base): Do not touch
+ volatile accesses if the decl isn't volatile.
+
2018-02-15 Jason Merrill <jason@redhat.com>
PR c++/84314 - ICE with templates and fastcall attribute.
+2018-02-16 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/84190
+ * g++.dg/torture/pr84190.C: New testcase.
+
2018-02-15 Martin Sebor <msebor@redhat.com>
* gcc.dg/lto/README (dg-lto-warning, dg-lto-message): Document new
--- /dev/null
+// { dg-do compile }
+// For slim LTO there's no optimized dump
+// { dg-skip-if "" { *-*-* } { "-flto" } { "" } }
+// { dg-additional-options "-fdump-tree-optimized" }
+
+typedef double T;
+static int equalfn (volatile T* x, volatile T* y);
+T gx, gy;
+int main ()
+{
+ T x = gx, y = gy;
+ return equalfn (&x, &y);
+}
+static int equalfn (volatile T* x, volatile T* y)
+{
+ return (*x == *y);
+}
+
+// There should be exactly two volatile accesses (ignoring clobbers).
+// { dg-final { scan-tree-dump-times " ={v} \[^\{\]" 2 "optimized" } }
if (! DECL_P (decl))
return NULL_TREE;
if (! is_gimple_reg_type (TREE_TYPE (base))
- || VOID_TYPE_P (TREE_TYPE (base)))
+ || VOID_TYPE_P (TREE_TYPE (base))
+ || TREE_THIS_VOLATILE (decl) != TREE_THIS_VOLATILE (base))
return decl;
if ((TREE_CODE (TREE_TYPE (decl)) == VECTOR_TYPE
|| TREE_CODE (TREE_TYPE (decl)) == COMPLEX_TYPE)