+2018-01-26 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/83989
+ * gimple-ssa-warn-restrict.c (builtin_memref::builtin_memref): Don't
+ use SSA_NAME_VAR as base for SSA_NAMEs with non-NULL SSA_NAME_VAR.
+
2018-01-26 Claudiu Zissulescu <claziss@synopsys.com>
* config/arc/arc-arch.h (arc_tune_attr): Add ARC_TUNE_CORE_3.
+2018-01-26 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/83989
+ * c-c++-common/Wrestrict-3.c: New test.
+
2018-01-26 Claudiu Zissulescu <claziss@synopsys.com>
* testsuite/gcc.target/arc/tdelegitimize_addr.c: New test.
--- /dev/null
+/* PR c/83989 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wrestrict" } */
+
+__attribute__((__malloc__)) extern void *my_malloc (__SIZE_TYPE__);
+void baz (void *);
+
+#define SIZE 32
+
+void
+foo (void)
+{
+ void *recmem = __builtin_malloc (SIZE);
+ baz (recmem);
+ while (1)
+ {
+ void *oldrecmem = recmem;
+ recmem = __builtin_malloc (SIZE);
+ if (!recmem)
+ {
+ __builtin_free (oldrecmem);
+ return;
+ }
+ __builtin_memcpy (recmem, oldrecmem, SIZE); /* { dg-bogus "accessing" } */
+ baz (recmem);
+ __builtin_free (oldrecmem);
+ }
+}
+
+void
+bar (void)
+{
+ void *recmem = my_malloc (SIZE);
+ baz (recmem);
+ while (1)
+ {
+ void *oldrecmem = recmem;
+ recmem = my_malloc (SIZE);
+ if (!recmem)
+ {
+ __builtin_free (oldrecmem);
+ return;
+ }
+ __builtin_memcpy (recmem, oldrecmem, SIZE); /* { dg-bogus "accessing" } */
+ baz (recmem);
+ __builtin_free (oldrecmem);
+ }
+}