PR tree-optimization/57230
* tree-ssa-strlen.c (handle_char_store): Add missing integer_zerop
check.
* gcc.dg/strlenopt-23.c: New test.
From-SVN: r198813
+2013-05-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/57230
+ * tree-ssa-strlen.c (handle_char_store): Add missing integer_zerop
+ check.
+
2013-05-12 Joern Rennecke <joern.rennecke@embecosm.com>
* config/epiphany/epiphany.c (epiphany_init): Check size of
+2013-05-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/57230
+ * gcc.dg/strlenopt-23.c: New test.
+
2013-05-12 Oleg Endo <olegendo@gcc.gnu.org>
PR target/57108
--- /dev/null
+/* PR tree-optimization/57230 */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+#include "strlenopt.h"
+
+int
+main ()
+{
+ char p[] = "hello world";
+ p[0] = (char) (strlen (p) - 1);
+ if (strlen (p) != 11)
+ abort ();
+ return 0;
+}
its length may be decreased. */
adjust_last_stmt (si, stmt, false);
}
- else if (si != NULL)
+ else if (si != NULL && integer_zerop (gimple_assign_rhs1 (stmt)))
{
si = unshare_strinfo (si);
si->length = build_int_cst (size_type_node, 0);