Bug 36745 - [4.4 Regression] ICE in gen_reg_rtx, at emit-rtl.c:868
Summary: [4.4 Regression] ICE in gen_reg_rtx, at emit-rtl.c:868
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.4.0
: P3 normal
Target Milestone: 4.4.0
Assignee: Andreas Krebbel
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2008-07-06 18:24 UTC by Richard Biener
Modified: 2008-07-18 16:59 UTC (History)
3 users (show)

See Also:
Host:
Target: s390-*-*, s390x-*-*
Build:
Known to work:
Known to fail:
Last reconfirmed: 2008-07-07 12:35:23


Attachments
testcase (1.10 KB, text/plain)
2008-07-06 18:24 UTC, Richard Biener
Details
slightly shorter (different testcase, same bug) (349 bytes, text/plain)
2008-07-07 09:00 UTC, Dirk Mueller
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Biener 2008-07-06 18:24:08 UTC
Trunk fails to build Qt4 on both s390 and s390x.

./cc1plus -quiet -O2 -fPIC qregexp.3.ii 
qregexp.3.ii: In member function 'void QVector<T>::realloc(int, int) [with T = QRegExpAutomatonState]':
qregexp.3.ii:99: internal compiler error: in gen_reg_rtx, at emit-rtl.c:868
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Comment 1 Richard Biener 2008-07-06 18:24:50 UTC
Created attachment 15864 [details]
testcase

Testcase reduced with a cross from x86_64 to s390x.
Comment 2 Dirk Mueller 2008-07-07 09:00:30 UTC
Created attachment 15868 [details]
slightly shorter (different testcase, same bug)
Comment 3 Andreas Krebbel 2008-07-07 12:35:23 UTC
The shorter testcase does not fail with -O2 -fPIC on GCC rev. 137553.

But I can confirm the ICE with the first example.  For large GOTs (>4k) we rewrite a symbol reference as a GOTENT relocation in the LEGITIMIZE_ADDRESS hook. A reference to the original SYM_REF stays as REG_EQUAL note. The note is used by GCSE to propagate the SYM_REF directly into the asm operand. So the legitimize_address hook is called for this operand during reload - since the fix needs an additional pseudo it crashes.
Comment 4 Andreas Krebbel 2008-07-14 06:57:25 UTC
Subject: Bug 36745

Author: krebbel
Date: Mon Jul 14 06:56:46 2008
New Revision: 137777

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=137777
Log:
2008-07-14  Andreas Krebbel  <krebbel1@de.ibm.com>

	PR target/36745
	* config/s390/s390.c: (s390_secondary_reload): Add a secondary
	reload for symbol refs moved to r0 with -fPIC.
	(legitimize_pic_address): Use the target register as temporary
	reg if possible.
	(emit_symbolic_move): Adjust comment.
	* config/s390/s390.md (reloadsi_PIC_addr, reloaddi_PIC_addr):
	New expanders.

2008-07-14  Andreas Krebbel  <krebbel1@de.ibm.com>

	PR target/36745
	* g++.dg/torture/pr36745.C: New testcase.



Added:
    trunk/gcc/testsuite/g++.dg/torture/pr36745.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/s390/s390.c
    trunk/gcc/config/s390/s390.md
    trunk/gcc/testsuite/ChangeLog

Comment 5 Jakub Jelinek 2008-07-14 13:47:28 UTC
Subject: Bug 36745

Author: jakub
Date: Mon Jul 14 13:46:25 2008
New Revision: 137785

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=137785
Log:
	PR target/36745
	* g++.dg/torture/pr36745.C: Use __SIZE_TYPE__ in size_t typedef.

Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/torture/pr36745.C

Comment 6 Richard Biener 2008-07-18 16:59:15 UTC
Fixed I guess.