User account creation filtered due to spam.

Bug 24950 - [3.4/4.0/4.1/4.2 Regression] ICE in operand_subword_force
Summary: [3.4/4.0/4.1/4.2 Regression] ICE in operand_subword_force
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.1.0
: P3 normal
Target Milestone: 4.0.3
Assignee: Alan Modra
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords: ice-on-valid-code, patch
Depends on:
Blocks:
 
Reported: 2005-11-20 09:14 UTC by Andreas Jaeger
Modified: 2005-12-12 20:08 UTC (History)
3 users (show)

See Also:
Host: powerpc64-linux-gnu
Target: powerpc64-linux-gnu
Build: powerpc64-linux-gnu
Known to work: 3.2.3
Known to fail: 4.1.0 4.2.0 4.0.3 3.4.5
Last reconfirmed: 2005-11-21 07:08:37


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Jaeger 2005-11-20 09:14:38 UTC
Running the testsuite I get the following ICE on the 4.1 branch:
Executing on host: /abuild/aj/gcc/gcc/xgcc -B/abuild/aj/gcc/gcc/ /aj-cvs/gcc-svn/branches/gcc-4_1-branch/gcc/testsuite/gcc.c-torture/execute/20051113-1
.c  -w  -O0  -fno-show-column  -lm   -m64 -o /abuild/aj/gcc/gcc/testsuite/20051113-1.x0    (timeout = 300)
/aj-cvs/gcc-svn/branches/gcc-4_1-branch/gcc/testsuite/gcc.c-torture/execute/20051113-1.c: In function 'main':
/aj-cvs/gcc-svn/branches/gcc-4_1-branch/gcc/testsuite/gcc.c-torture/execute/20051113-1.c:60: internal compiler error: in operand_subword_force, at emit
-rtl.c:1386
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
compiler exited with status 1
output is:
/aj-cvs/gcc-svn/branches/gcc-4_1-branch/gcc/testsuite/gcc.c-torture/execute/20051113-1.c: In function 'main':
/aj-cvs/gcc-svn/branches/gcc-4_1-branch/gcc/testsuite/gcc.c-torture/execute/20051113-1.c:60: internal compiler error: in operand_subword_force, at emit
-rtl.c:1386
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

FAIL: gcc.c-torture/execute/20051113-1.c compilation,  -O0

Compiler is:
/opt/gcc/4.1-devel/bin/gcc -v
Using built-in specs.
Target: powerpc64-suse-linux-gnu
Configured with: /aj-cvs/gcc-svn/branches/gcc-4_1-branch/configure --prefix=/opt/gcc/4.1-devel --enable-checking=misc,tree,gc,rtl,rtlflag,assert --enable-threads=posix --enable-clocale=gnu --enable-__cxa_atexit --enable-shared --enable-languages=c,c++,treelang,java,f95,objc --with-system-zlib --with-cpu=default32 powerpc64-suse-linux-gnu
Thread model: posix
gcc version 4.1.0 20051119 (prerelease)
Comment 1 Andrew Pinski 2005-11-21 01:42:07 UTC
Fails:
http://gcc.gnu.org/ml/gcc-testresults/2005-11/msg00998.html
http://gcc.gnu.org/ml/gcc-testresults/2005-11/msg00840.html

Hmm, this has failed since the testcase was added, I have to manually check if it is a regression.
Comment 2 Andrew Pinski 2005-11-21 01:53:20 UTC
Confirmed, does not look like a regression though you can never tell.
Comment 3 Andrew Pinski 2005-11-21 02:22:29 UTC
This works in 3.2.3 so it is a regression from there.
Comment 4 Alan Modra 2005-11-21 02:24:27 UTC
No ice with 3.3.3 either
Comment 5 Alan Modra 2005-11-21 02:28:56 UTC
Err, that was 3.3.3-hammer I tested.
Comment 6 Alan Modra 2005-11-21 07:08:37 UTC
Testing a fix.  The reason gcc-3.3 doesn't fail on this testcase is that the first arg to store_bit_field there is a mem:BLK while gcc-3.4 and gcc-4 pass a mem:SI.  Code after the following comment in store_bit_field fails badly, trying to insert a 64-bit field into an SImode reg.

	  /* Get the mode to use for inserting into this field.  If OP0 is
	     BLKmode, get the smallest mode consistent with the alignment. If
	     OP0 is a non-BLKmode object that is no wider than MAXMODE, use its
	     mode. Otherwise, use the smallest mode containing the field.  */

I think we just need to check that bestmode is at least as big as fieldmode.  This will prevent trying to use insv, and fall thru to store_fixed_bit_field, which is what happens with a BLKmode MEM.
Comment 7 Alan Modra 2005-11-22 13:16:36 UTC
Subject: Bug 24950

Author: amodra
Date: Tue Nov 22 13:16:29 2005
New Revision: 107354

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=107354
Log:
	PR middle-end/24950
	* expmed.c (store_bit_field): Don't attempt to insv a field
	larger than the reg.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/expmed.c

Comment 8 Alan Modra 2005-11-22 13:18:09 UTC
Subject: Bug 24950

Author: amodra
Date: Tue Nov 22 13:18:01 2005
New Revision: 107355

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=107355
Log:
	PR middle-end/24950
	* expmed.c (store_bit_field): Don't attempt to insv a field
	larger than the reg.


Modified:
    branches/gcc-4_1-branch/gcc/ChangeLog
    branches/gcc-4_1-branch/gcc/expmed.c

Comment 9 Alan Modra 2005-11-23 12:05:45 UTC
Subject: Bug 24950

Author: amodra
Date: Wed Nov 23 12:05:41 2005
New Revision: 107417

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=107417
Log:
	PR middle-end/24950
	* expmed.c (store_bit_field): Don't attempt to insv a field
	larger than the reg.

	Merge from trunk
	2005-11-14  Dale Johannesen  <dalej@apple.com>
	* expmed.c (store_bit_field):  Add offset unconditionally for
	memory targets.
	(extract_bit_field):  Don't force extzv or extv operand into
	a register if field is too big.
	2004-12-01  Richard Henderson  <rth@redhat.com>
	* expmed.c (store_bit_field): Use simplify_gen_subreg instead
	of gen_rtx_SUBREG directly.


Modified:
    branches/gcc-3_4-branch/gcc/ChangeLog
    branches/gcc-3_4-branch/gcc/expmed.c

Comment 10 Alan Modra 2005-11-23 12:07:17 UTC
Subject: Bug 24950

Author: amodra
Date: Wed Nov 23 12:07:14 2005
New Revision: 107418

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=107418
Log:
	PR middle-end/24950
	Copy from trunk 2005-11-14  Dale Johannesen  <dalej@apple.com>
	* gcc.c-torture/execute/20051113-1.c:  New.


Added:
    branches/gcc-3_4-branch/gcc/testsuite/gcc.c-torture/execute/20051113-1.c
      - copied unchanged from r106920, trunk/gcc/testsuite/gcc.c-torture/execute/20051113-1.c
Modified:
    branches/gcc-3_4-branch/gcc/testsuite/ChangeLog

Comment 11 Alan Modra 2005-11-23 22:15:20 UTC
Subject: Bug 24950

Author: amodra
Date: Wed Nov 23 22:15:16 2005
New Revision: 107433

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=107433
Log:
	PR middle-end/24950
	* expmed.c (store_bit_field): Don't attempt to insv a field
	larger than the reg.

	Merge from trunk 2005-11-14  Dale Johannesen  <dalej@apple.com>
	* expmed.c (store_bit_field):  Add offset unconditionally for
	memory targets.
	(extract_bit_field):  Don't force extzv or extv operand into
	a register if field is too big.


Modified:
    branches/gcc-4_0-branch/gcc/ChangeLog
    branches/gcc-4_0-branch/gcc/expmed.c

Comment 12 Alan Modra 2005-11-23 22:16:33 UTC
Fixed
Comment 13 Alan Modra 2005-11-23 22:31:31 UTC
Subject: Bug 24950

Author: amodra
Date: Wed Nov 23 22:31:26 2005
New Revision: 107434

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=107434
Log:
	PR middle-end/24950
	Copy from trunk 2005-11-14  Dale Johannesen  <dalej@apple.com>
	* gcc.c-torture/execute/20051113-1.c:  New.


Added:
    branches/gcc-4_0-branch/gcc/testsuite/gcc.c-torture/execute/20051113-1.c
      - copied unchanged from r106920, trunk/gcc/testsuite/gcc.c-torture/execute/20051113-1.c
Modified:
    branches/gcc-4_0-branch/gcc/testsuite/ChangeLog

Comment 14 Dale Johannesen 2005-12-01 18:04:24 UTC
Subject: Bug 24950

Author: dalej
Date: Thu Dec  1 18:04:20 2005
New Revision: 107826

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=107826
Log:
2005-12-01   Alan Modra  <amodra@bigpond.net.au>

        Radar 4345871
    `   PR middle-end/24950
        * expmed.c (store_bit_field): Don't attempt to insv a field
        larger than the reg.


Modified:
    branches/apple-local-200502-branch/gcc/ChangeLog.apple-ppc
    branches/apple-local-200502-branch/gcc/expmed.c