Add PR markers to recent DSE changes. And...
authorJeff Law <law@redhat.com>
Tue, 23 Jul 2019 20:05:48 +0000 (14:05 -0600)
committerJeff Law <law@gcc.gnu.org>
Tue, 23 Jul 2019 20:05:48 +0000 (14:05 -0600)
PR tree-optimization/86061
* gcc.dg/tree-ssa/pr86061.c: New test.

From-SVN: r273745

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/pr86061.c [new file with mode: 0644]

index d405921425f637569e86d77fa220bcc82f3345e2..c6c0f4a70af727fc54bc0fc8b1e8fe0568d76053 100644 (file)
 
 2019-07-19  Jeff Law  <law@redhat.com>
 
+       PR tree-optimization/86061
        * tree-ssa-dse.c (initialize_ao_ref_for_dse): Handle
        strncpy.  Drop some trivial dead code.
        (maybe_trim_memstar_call): Handle strncpy.
index 8e6b02668fbbfaf469dacc86e839059a619c6bf7..14fe6b9cb27ecbf65e3a3fff165c2a2586c72f58 100644 (file)
@@ -1,3 +1,8 @@
+2019-07-23  Jeff Law  <law@redhat.com>
+
+       PR tree-optimization/86061
+       * gcc.dg/tree-ssa/pr86061.c: New test.
+
 2019-07-23  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/83518
 
 2019-07-19  Jeff Law  <law@redhat.com>
 
+       PR tree-optimization/86061
        * gcc.dg/tree-ssa/ssa-dse-37.c: New test.
        * gcc.dg/tree-ssa/ssa-dse-38.c: New test.
 
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr86061.c b/gcc/testsuite/gcc.dg/tree-ssa/pr86061.c
new file mode 100644 (file)
index 0000000..f2b0792
--- /dev/null
@@ -0,0 +1,20 @@
+/* { dg-options "-O2 -fdump-tree-dse-details -fno-tree-fre" } */
+
+
+struct S { int i; char n[128]; int j; };
+
+void f (char*);
+
+void g (struct S *p)
+{
+  char a[sizeof p->n + 1];
+
+  __builtin_memset (a, 0, sizeof a);   // dead store, can be eliminated
+
+  __builtin_strncpy (a, p->n, sizeof a - 1);
+  a[sizeof a - 1] = '\0';
+
+  f (a);
+}
+
+/* { dg-final { scan-tree-dump-times "Deleted dead call" 1 "dse1" } } */