PR middle-end/38343
* builtins.c (fold_builtin_memory_op): Convert len to sizetype
before using it in POINTER_PLUS_EXPR.
* gcc.c-torture/compile/pr38343-2.c: New test.
From-SVN: r142363
+2008-12-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/38343
+ * builtins.c (fold_builtin_memory_op): Convert len to sizetype
+ before using it in POINTER_PLUS_EXPR.
+
2008-12-02 Richard Guenther <rguenther@suse.de>
PR tree-optimization/38359
len = fold_build2 (MINUS_EXPR, TREE_TYPE (len), len,
ssize_int (1));
+ len = fold_convert (sizetype, len);
dest = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (dest), dest, len);
dest = fold_convert (type, dest);
if (expr)
+2008-12-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/38343
+ * gcc.c-torture/compile/pr38343-2.c: New test.
+
2008-12-02 Richard Guenther <rguenther@suse.de>
PR tree-optimization/38359
--- /dev/null
+/* PR middle-end/38343 */
+
+static struct S
+{
+ char f[6];
+} s[] = { {"01000"} };
+
+char *
+foo (void)
+{
+ return __builtin_stpcpy (s[0].f, "S0022");
+}