Bug 40291 - [4.3 Regression] ICE on unprototyped memcmp with long long last argument
Summary: [4.3 Regression] ICE on unprototyped memcmp with long long last argument
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.4.0
: P2 normal
Target Milestone: 4.3.4
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2009-05-29 12:51 UTC by Jakub Jelinek
Modified: 2009-07-10 16:04 UTC (History)
1 user (show)

See Also:
Host:
Target: i686-linux
Build:
Known to work: 3.4.6 4.3.4 4.4.1 4.5.0
Known to fail: 4.0.3 4.1.2 4.2.2 4.3.3 4.4.0
Last reconfirmed: 2009-05-29 12:53:57


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jakub Jelinek 2009-05-29 12:51:59 UTC
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.
Comment 1 Jakub Jelinek 2009-05-29 12:53:57 UTC
Works with 3.4.x.
Testing a patch.
Comment 2 Jakub Jelinek 2009-05-29 15:38:38 UTC
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

Comment 3 Jakub Jelinek 2009-05-29 15:47:44 UTC
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

Comment 4 Jakub Jelinek 2009-05-29 15:51:12 UTC
Fixed for 4.4/4.5 so far.
Comment 5 Richard Biener 2009-07-10 16:02:00 UTC
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

Comment 6 Richard Biener 2009-07-10 16:04:50 UTC
Fixed.