@@ -1114,7 +1114,7 @@ forward_propagate_addr_expr (tree name,
}
}
- return all;
+ return all && has_zero_uses (name);
}
/* Forward propagate the comparison defined in STMT like
@@ -0,0 +1,14 @@
+/* PR tree-optimization/47443 */
+/* { dg-do compile } */
+/* { dg-options "-O -fstack-check=generic" } */
+
+static inline bar (char *c, int i)
+{
+ return c + i > c;
+}
+
+int foo ()
+{
+ char c[100];
+ return (bar (c, 1));
+}
@@ -0,0 +1,20 @@
+/* PR tree-optimization/47265 */
+
+struct S
+{
+ char a[3];
+ char b[3];
+};
+
+void
+bar (char *dst, const char *src, unsigned n)
+{
+ while (n--)
+ *dst++ = *src ? *src++ : ' ';
+}
+
+void
+foo (struct S *s)
+{
+ bar (s->a, s->b, 3);
+}