Bug 19378

Summary: [4.0 Regression] ICE during bootstrap compiling __fixdfdi
Product: gcc Reporter: Joel Sherrill <joel>
Component: targetAssignee: denisc
Status: RESOLVED FIXED    
Severity: normal CC: corsepiu, denisc, dgay, dj, eric.weddington, gcc-bugs, marekm, mmitchel
Priority: P3 Keywords: build, ice-on-valid-code, patch
Version: 4.0.0   
Target Milestone: 4.0.0   
Host: Target: avr
Build: Known to work:
Known to fail: Last reconfirmed: 2005-01-11 17:15:44
Bug Depends on: 18887    
Bug Blocks:    

Description Joel Sherrill 2005-01-11 16:29:12 UTC
gcc-4.0 20050109 
binutils 2.15
newlib 1.13.0

[NOTE: I included avr-elf since this failure should be early enough in the build
process to duplicate with that.]

avr-rtems4.7 fails to bootstrap.  Fails with this:

./gcc-4.0.20050109/gcc/../newlib/libc/sys/rtems/include -DIN_GCC -DCROSS_COMPILE
  -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
-Wold-style-definition  -isystem ./include  -DDF=SF -Dinhibit_libc
-mcall-prologues -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED
-Dinhibit_libc -I. -I -I../../gcc-4.0.20050109/gcc -I../../gcc-4.0.20050109/gcc/
-I../../gcc-4.0.20050109/gcc/../include
-I../../gcc-4.0.20050109/gcc/../libcpp/include  -DL_fixdfdi -c
../../gcc-4.0.20050109/gcc/libgcc2.c -o libgcc/./_fixdfdi.o
../../gcc-4.0.20050109/gcc/libgcc2.c: In function '__fixdfdi':
../../gcc-4.0.20050109/gcc/libgcc2.c:1267: internal compiler error: in
find_valid_class, at reload.c:719
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Comment 1 Andrew Pinski 2005-01-11 17:15:43 UTC
Note there was another bug opened which will also fix the avr bootstrap failure but does not fix the ICE, 
only works around the problem (PR 18887).
Comment 2 Andrew Pinski 2005-01-11 17:17:45 UTC
As mentioned in PR 18887 in comment #9, the ICE was caused by:
+2004-12-06  DJ Delorie  <dj@redhat.com>
+
+       * reload.c (find_valid_class): Fix logic to test inner mode as well.
+       (push_reload): Pass inner mode.


The problem is not *in* this patch, but while waiting for
a proper fix, I could get GCC to build again for AVR by
reversing it locally.
Comment 3 Andrew Pinski 2005-01-14 18:37:28 UTC
*** Bug 19446 has been marked as a duplicate of this bug. ***
Comment 4 Andrew Pinski 2005-01-14 21:44:38 UTC
Patch here: <http://gcc.gnu.org/ml/gcc-patches/2005-01/msg00834.html>.
Comment 5 Ralf Corsepius 2005-01-18 03:02:21 UTC
(In reply to comment #4)
> Patch here: <http://gcc.gnu.org/ml/gcc-patches/2005-01/msg00834.html>.
This patch lets building succeed for avr-rtems*.
Comment 6 Mark Mitchell 2005-01-21 17:32:42 UTC
AVR is not a primary or secondary platform; removing target milestone.
Comment 7 Joel Sherrill 2005-01-22 13:02:26 UTC
(In reply to comment #6)
> AVR is not a primary or secondary platform; removing target milestone.

Understood but there is a patch from Rager Sayle and all it needs is to be
reviewed and approved.  He posted tests rules and an explanation here:

http://gcc.gnu.org/ml/gcc-patches/2005-01/msg00834.html

He reports on avr-elf and I can confirm that this lets avr-rtems build.

Please approve this patch.
Comment 8 Mark Mitchell 2005-01-22 19:44:42 UTC
Subject: Re:  [4.0 Regression] ICE during bootstrap compiling
 __fixdfdi

joel at gcc dot gnu dot org wrote:
> ------- Additional Comments From joel at gcc dot gnu dot org  2005-01-22 13:02 -------
> (In reply to comment #6)
> 
>>AVR is not a primary or secondary platform; removing target milestone.
> 
> 
> Understood but there is a patch from Rager Sayle and all it needs is to be
> reviewed and approved.  He posted tests rules and an explanation here:
> 
> http://gcc.gnu.org/ml/gcc-patches/2005-01/msg00834.html
> 
> He reports on avr-elf and I can confirm that this lets avr-rtems build.
> 
> Please approve this patch.

The AVR maintainer should review that patch; it's certainly fine to 
commit if approved by the AVR maintainer.

Comment 9 Joel Sherrill 2005-01-22 21:28:14 UTC
I just assigned it to one AVR maintainer and cc'ed the other.  Could one of
you review this patch and commit it per Mark's request.
Comment 10 Marek Michalkiewicz 2005-01-23 00:14:49 UTC
I think the proposed avr_hard_regno_mode_ok patch may need a small fix for 
QImode in r29 - possible problem with frame pointer (see removed comment): 
 
-  if (regno <= REG_Y && (regno + GET_MODE_SIZE (mode)) >= (REG_Y + 1)) 
+  if (regno <= (REG_Y + 1) && regno + GET_MODE_SIZE (mode) > REG_Y) 
 
Comment 11 Paul Schlie 2005-01-23 00:25:58 UTC
(In reply to comment #10)

have you had a chance to look at Roger's more recient patch:

 http://gcc.gnu.org/ml/gcc-patches/2005-01/msg01181.html

Comment 12 CVS Commits 2005-01-23 04:51:43 UTC
Subject: Bug 19378

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	sayle@gcc.gnu.org	2005-01-23 04:51:29

Modified files:
	gcc            : ChangeLog 
	gcc/config/avr : avr.c 

Log message:
	PR middle-end/19378
	* config/avr/avr.c (avr_hard_regno_mode_ok): Rewrite.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.7239&r2=2.7240
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/avr/avr.c.diff?cvsroot=gcc&r1=1.125&r2=1.126

Comment 13 Andrew Pinski 2005-01-23 05:29:05 UTC
Fixed.