* builtins.c (fold_builtin_strncpy): Make sure len is a constant
before comparing it as such.
From-SVN: r84343
+2004-07-09 Alexandre Oliva <aoliva@redhat.com>
+
+ * builtins.c (fold_builtin_strncpy): Make sure len is a constant
+ before comparing it as such.
+
2004-07-08 Richard Henderson <rth@redhat.com>
* builtins.c (std_gimplify_va_arg_expr): Hoist valist into a
if (integer_zerop (len))
return omit_one_operand (TREE_TYPE (exp), dest, src);
+ /* We can't compare slen with len as constants below if len is not a
+ constant. */
+ if (len == 0 || TREE_CODE (len) != INTEGER_CST)
+ return 0;
+
if (!slen)
slen = c_strlen (src, 1);