diff gcc/testsuite/gcc.dg/pr23911.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gcc/testsuite/gcc.dg/pr23911.c	Fri Oct 27 22:46:09 2017 +0900
@@ -0,0 +1,20 @@
+/* This was a missed optimization in tree constant propagation
+   that CSE would catch later on.  */
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-dce3" } */
+
+double _Complex *a; 
+static const double _Complex b[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; 
+ 
+void 
+test (void) 
+{ 
+  a[0] = b[0] + b[1]; 
+  a[1] = b[0] + b[1]; 
+  return; 
+} 
+
+/* After DCE2 which runs after FRE, the expressions should be fully
+   constant folded.  There should be no loads from b left.  */
+/* { dg-final { scan-tree-dump-times "__complex__ \\\(1.0e\\\+0, 0.0\\\)" 2 "dce3" } } */
+/* { dg-final { scan-tree-dump-times "= b" 0 "dce3" } } */