2018-08-28 Richard Biener <rguenther@suse.de>
PR tree-optimization/87117
* tree-ssa-sccvn.c (fully_constant_vn_reference_p): Exclude
void which is is_gimple_reg_type by checking for COMPLETE_TYPE_P.
* gcc.dg/pr87117-1.c: New testcase.
From-SVN: r263911
+2018-08-28 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/87117
+ * tree-ssa-sccvn.c (fully_constant_vn_reference_p): Exclude
+ void which is is_gimple_reg_type by checking for COMPLETE_TYPE_P.
+
2018-08-28 Richard Biener <rguenther@suse.de>
PR tree-optimization/87117
+2018-08-28 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/87117
+ * gcc.dg/pr87117-1.c: New testcase.
+
2018-08-28 Richard Biener <rguenther@suse.de>
PR tree-optimization/87117
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-inline -fno-tree-dce" } */
+
+int a, b, c;
+long *d;
+void fn1()
+{
+ for (; 0 < a;)
+ a++;
+}
+void fn3()
+{
+ for (; c; c++)
+ d[c] = 0;
+}
+void fn2()
+{
+ if (b)
+ fn3();
+ fn1();
+}
/* Simplify reads from constants or constant initializers. */
else if (BITS_PER_UNIT == 8
+ && COMPLETE_TYPE_P (ref->type)
&& is_gimple_reg_type (ref->type)
&& (!INTEGRAL_TYPE_P (ref->type)
|| TYPE_PRECISION (ref->type) % BITS_PER_UNIT == 0))