Bug 49154 - [4.7 Regression]: build fails on cris-elf in libgcc: ICE in setup_pressure_classes, at ira.c:902
Summary: [4.7 Regression]: build fails on cris-elf in libgcc: ICE in setup_pressure_cl...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 4.7.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL: http://gcc.gnu.org/ml/gcc-patches/201...
Keywords: build, ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2011-05-25 00:18 UTC by Hans-Peter Nilsson
Modified: 2011-06-10 03:04 UTC (History)
2 users (show)

See Also:
Host: x86_64-unknown-linux-gnu
Target: cris-axis-elf
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
A patch to the CRIS port to go with the documentation update. (2.13 KB, patch)
2011-06-09 01:31 UTC, Hans-Peter Nilsson
Details | Diff
Repeat mentioned SEGV at patched r174780 with "cc1 -fpreprocessed -O2 libgcc2.i -march=v10" (10.14 KB, text/plain)
2011-06-09 01:54 UTC, Hans-Peter Nilsson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hans-Peter Nilsson 2011-05-25 00:18:56 UTC
A patch in the revision range (last_known_working:first_known_failing) 174114:174124 caused the build for cris-elf to fail as follows:

...
checking whether ln -s works... yes
checking for cris-elf-gcc... /tmp/hpautotest-gcc1/cris-elf/gccobj/./gcc/xgcc -B/tmp/hpautotest-gcc1/cris-elf/gccobj/./gcc/ -nostdinc -B/tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/newlib/ -isystem /tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/newlib/targ-include -isystem /tmp/hpautotest-gcc1/gcc/newlib/libc/include -B/tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/libgloss/cris -L/tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/libgloss/libnosys -L/tmp/hpautotest-gcc1/gcc/libgloss/cris -B/tmp/hpautotest-gcc1/cris-elf/pre/cris-elf/bin/ -B/tmp/hpautotest-gcc1/cris-elf/pre/cris-elf/lib/ -isystem /tmp/hpautotest-gcc1/cris-elf/pre/cris-elf/include -isystem /tmp/hpautotest-gcc1/cris-elf/pre/cris-elf/sys-include   
checking for suffix of object files... configure: error: in `/tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make[1]: *** [configure-target-libgcc] Error 1
make[1]: Leaving directory `/tmp/hpautotest-gcc1/cris-elf/gccobj'

The applicable part of that config.log is:

configure:3268: /tmp/hpautotest-gcc1/cris-elf/gccobj/./gcc/xgcc -B/tmp/hpautotest-gcc1/cris-elf/gccobj/./gcc/ -nostdinc -B/tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/newlib/ -isystem /tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/newlib/targ-include -isystem /tmp/hpautotest-gcc1/gcc/newlib/libc/include -B/tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/libgloss/cris -L/tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/libgloss/libnosys -L/tmp/hpautotest-gcc1/gcc/libgloss/cris -B/tmp/hpautotest-gcc1/cris-elf/pre/cris-elf/bin/ -B/tmp/hpautotest-gcc1/cris-elf/pre/cris-elf/lib/ -isystem /tmp/hpautotest-gcc1/cris-elf/pre/cris-elf/include -isystem /tmp/hpautotest-gcc1/cris-elf/pre/cris-elf/sys-include    -c -g -O2  conftest.c >&5
conftest.c:1:0: internal compiler error: in setup_pressure_classes, at ira.c:902
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
configure:3272: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU C Runtime Library"
| #define PACKAGE_TARNAME "libgcc"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "GNU C Runtime Library 1.0"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL "http://www.gnu.org/software/libgcc/"
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }

Author of suspect patches in revision range CC:ed.
Comment 1 Rainer Orth 2011-05-25 14:44:53 UTC
Same error on Solaris 11/SPARC.
Comment 2 Vladimir Makarov 2011-05-26 21:02:03 UTC
Author: vmakarov
Date: Thu May 26 21:01:57 2011
New Revision: 174309

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174309
Log:
2011-05-26  Vladimir Makarov  <vmakarov@redhat.com>

	PR rtl-optimization/49154
	* ira.c (setup_pressure_classes): Process class without sublcasses
	as a candidate for pressure classes.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/ira.c
Comment 3 Hans-Peter Nilsson 2011-06-06 12:49:50 UTC
It's either an IRA bug, or a documentation issue (and subsequently a target bug). Suggested patch at URL to amend the documentation.
Comment 4 Hans-Peter Nilsson 2011-06-06 12:53:22 UTC
I'm removing sparc-sun-solaris2* from the target field as that was fixed by the commit in the audit trail.
Comment 5 Hans-Peter Nilsson 2011-06-09 01:31:26 UTC
Created attachment 24470 [details]
A patch to the CRIS port to go with the documentation update.

Unfortunately when this patch by itself is applied, we run into a SEGV in IRA.
Will post that patch momentarily.
Comment 6 Hans-Peter Nilsson 2011-06-09 01:54:41 UTC
Created attachment 24471 [details]
Repeat mentioned SEGV at patched r174780 with "cc1 -fpreprocessed  -O2 libgcc2.i -march=v10"
Comment 7 Hans-Peter Nilsson 2011-06-09 02:34:02 UTC
(In reply to comment #5)
> Will post that patch momentarily.
Done: <http://gcc.gnu.org/ml/gcc-patches/2011-06/msg00697.html>
Comment 8 Hans-Peter Nilsson 2011-06-09 23:36:24 UTC
Author: hp
Date: Thu Jun  9 23:36:22 2011
New Revision: 174867

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174867
Log:
	PR rtl-optimization/49154
	* doc/tm.texi.in (Register Classes): Document rule for the narrowest
	register classes.
	* doc/tm.texi: Regenerate.
(oops, forgot the PR markers)

Modified:
    trunk/gcc/ChangeLog
Comment 9 Hans-Peter Nilsson 2011-06-09 23:38:38 UTC
Author: hp
Date: Thu Jun  9 23:38:35 2011
New Revision: 174868

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174868
Log:
	PR rtl-optimization/49154
	* ira-costs.c (setup_regno_cost_classes_by_mode): If there
	already is a matching slot in the hashtable, assign it to
	classes_ptr.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/ira-costs.c
Comment 10 Hans-Peter Nilsson 2011-06-09 23:45:47 UTC
Author: hp
Date: Thu Jun  9 23:45:45 2011
New Revision: 174870

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174870
Log:
	PR rtl-optimization/49154
	* config/cris/cris.h (FIXED_REGISTERS): Include CRIS_CC0_REGNUM.
	(enum reg_class): Add SRP_REGS and MOF_SRP_REGS.
	(REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGNO_REG_CLASS)
	(PREFERRED_RELOAD_CLASS, SECONDARY_RELOAD_CLASS): Adjust to fit.
	* config/cris/cris.h (cris_register_move_cost): Remove
	!TARGET_V32 code.  Tweak comments.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/cris/cris.c
    trunk/gcc/config/cris/cris.h
Comment 11 Hans-Peter Nilsson 2011-06-10 03:04:50 UTC
Autotester builds now succeed.