testcase for last_vuse in FRE
authorRichard Biener <rguenther@suse.de>
Tue, 25 Feb 2020 11:19:33 +0000 (12:19 +0100)
committerRichard Biener <rguenther@suse.de>
Tue, 25 Feb 2020 11:21:24 +0000 (12:21 +0100)
This adds a testcase for some basic FRE functionality.

2020-02-25  Richard Biener  <rguenther@suse.de>

* gcc.dg/tree-ssa/ssa-fre-86.c: New testcase.

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

index d25296df65b8800a47b129839167f8cccae866fd..10bbb73fc3d92497b301045add16e0747710d8cd 100644 (file)
@@ -1,3 +1,7 @@
+2020-02-25  Richard Biener  <rguenther@suse.de>
+
+       * gcc.dg/tree-ssa/ssa-fre-86.c: New testcase.
+
 2020-02-25  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/93868
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-86.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-86.c
new file mode 100644 (file)
index 0000000..d3da22c
--- /dev/null
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-fre1" } */
+
+int foo(int *p, int b, float *q)
+{
+  int tem;
+  if (b)
+    {
+      *q = 0;
+      tem = *p;
+    }
+  else
+    {
+      *q = 1;
+      tem = *p;
+    }
+  return *p - tem;
+}
+
+/* { dg-final { scan-tree-dump "return 0;" "fre1" } } */