int foo (void *x, char *y, unsigned long long z) { return memcmp (x, y, z); } ICEs with -m32 -O{,2,3} on i686/x86_64 with: rh503160.i: In function 'foo': rh503160.i:5: error: unrecognizable insn: (insn 10 9 11 3 rh503160.i:4 (parallel [ (set (reg:SI 65) (zero_extend:DI (reg/v:DI 62 [ z ]))) (clobber (reg:CC 17 flags)) ]) -1 (nil)) rh503160.i:5: internal compiler error: in extract_insn, at recog.c:2048 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions.
Works with 3.4.x. Testing a patch.
Subject: Bug 40291 Author: jakub Date: Fri May 29 15:38:20 2009 New Revision: 147978 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=147978 Log: PR middle-end/40291 * builtins.c (expand_builtin_memcmp): Convert len to sizetype before expansion. * gcc.c-torture/compile/pr40291.c: New test. Added: trunk/gcc/testsuite/gcc.c-torture/compile/pr40291.c Modified: trunk/gcc/ChangeLog trunk/gcc/builtins.c trunk/gcc/testsuite/ChangeLog
Subject: Bug 40291 Author: jakub Date: Fri May 29 15:47:31 2009 New Revision: 147979 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=147979 Log: PR middle-end/40291 * builtins.c (expand_builtin_memcmp): Convert len to sizetype before expansion. * gcc.c-torture/compile/pr40291.c: New test. Added: branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr40291.c Modified: branches/gcc-4_4-branch/gcc/ChangeLog branches/gcc-4_4-branch/gcc/builtins.c branches/gcc-4_4-branch/gcc/testsuite/ChangeLog
Fixed for 4.4/4.5 so far.
Subject: Bug 40291 Author: rguenth Date: Fri Jul 10 16:01:34 2009 New Revision: 149487 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=149487 Log: 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. Added: branches/gcc-4_3-branch/gcc/testsuite/gcc.c-torture/compile/pr40291.c Modified: branches/gcc-4_3-branch/gcc/ChangeLog branches/gcc-4_3-branch/gcc/builtins.c branches/gcc-4_3-branch/gcc/testsuite/ChangeLog
Fixed.