2009-07-10 Richard Guenther <rguenther@suse.de>
Backport from mainline
2009-05-29 Jakub Jelinek <jakub@redhat.com>
PR middle-end/40291
* builtins.c (expand_builtin_memcmp): Convert len to sizetype
before expansion.
* gcc.c-torture/compile/pr40291.c: New test.
From-SVN: r149487
+2009-07-10 Richard Guenther <rguenther@suse.de>
+
+ Backport from mainline
+ 2009-05-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/40291
+ * builtins.c (expand_builtin_memcmp): Convert len to sizetype
+ before expansion.
+
2009-07-10 Richard Guenther <rguenther@suse.de>
Backport from mainline
arg1_rtx = get_memory_rtx (arg1, len);
arg2_rtx = get_memory_rtx (arg2, len);
- arg3_rtx = expand_normal (len);
+ arg3_rtx = expand_normal (fold_convert (sizetype, len));
/* Set MEM_SIZE as appropriate. */
if (GET_CODE (arg3_rtx) == CONST_INT)
+2009-07-10 Richard Guenther <rguenther@suse.de>
+
+ Backport from mainline
+ 2009-05-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/40291
+ * gcc.c-torture/compile/pr40291.c: New test.
+
2009-07-10 Richard Guenther <rguenther@suse.de>
Backport from mainline
--- /dev/null
+/* PR middle-end/40291 */
+
+int
+foo (void *x, char *y, unsigned long long z)
+{
+ return memcmp (x, y, z);
+}