re PR middle-end/40291 (ICE on unprototyped memcmp with long long last argument)

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: r147978
This commit is contained in:
Jakub Jelinek 2009-05-29 17:38:20 +02:00 committed by Jakub Jelinek
parent da7ba240d6
commit 616f21dfde
4 changed files with 17 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2009-05-29 Jakub Jelinek <jakub@redhat.com>
PR middle-end/40291
* builtins.c (expand_builtin_memcmp): Convert len to sizetype
before expansion.
2009-05-29 Andrey Belevantsev <abel@ispras.ru>
PR rtl-optimization/40101

View File

@ -4189,7 +4189,7 @@ expand_builtin_memcmp (tree exp, rtx target, enum machine_mode mode)
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)

View File

@ -1,5 +1,8 @@
2009-05-29 Jakub Jelinek <jakub@redhat.com>
PR middle-end/40291
* gcc.c-torture/compile/pr40291.c: New test.
PR target/40017
* gcc.target/powerpc/altivec-types-1.c: Don't expect error for
__vector _Bool.
@ -22,7 +25,6 @@
* g++.dg/template/canon-type-6.C: Likewise.
* g++.dg/template/canon-type-7.C: Likewise.
2009-05-28 Dave Korn <dave.korn.cygwin@gmail.com>
Uros Bizjak <ubizjak@gmail.com>
Danny Smith <dansmister@gmail.com>

View File

@ -0,0 +1,7 @@
/* PR middle-end/40291 */
int
foo (void *x, char *y, unsigned long long z)
{
return memcmp (x, y, z);
}