Bug 12441 - [3.3 Regression] Can't spill register bug
Summary: [3.3 Regression] Can't spill register bug
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 3.3.2
: P2 critical
Target Milestone: 3.3.3
Assignee: Richard Henderson
URL:
Keywords: ice-on-valid-code
: 13514 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-09-29 09:41 UTC by andreas
Modified: 2004-01-12 14:18 UTC (History)
2 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2003-09-29 15:47:50


Attachments
Self-contained file triggering the bug. (1.27 KB, text/plain)
2003-09-29 09:43 UTC, andreas
Details

Note You need to log in before you can comment on or make changes to this bug.
Description andreas 2003-09-29 09:42:00 UTC
andreas@meo-dipt:~/gd/build/common/format$ gcc --version
gcc (GCC) 3.3.2 20030908 (Debian prerelease)
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

andreas@meo-dipt:~/gd/build/common/format$ gcc -O2 -c gcc-bug.c
gcc-bug.c: In function `formatZformatZbuf_format_integer_METH_INT_next_digit':
gcc-bug.c:148: error: unable to find a register to spill in class `Q_REGS'
gcc-bug.c:148: error: this is the insn:
(insn:HI 381 379 388 12 0x4001a790 (set (mem:QI (plus:SI (plus:SI (subreg:SI
(reg/v:DI 88) 4)
                    (subreg:SI (reg/v:DI 89) 0))
                (const_int 16 [0x10])) [0 S1 A8])
        (subreg:QI (reg/v:SI 4 esi [84]) 0)) 47 {*movqi_1} (nil)
    (expr_list:REG_DEAD (reg/v:DI 89)
        (expr_list:REG_DEAD (reg/v:DI 88)
            (expr_list:REG_DEAD (reg/v:SI 4 esi [84])
                (nil)))))
gcc-bug.c:148: confused by earlier errors, bailing out

The file in question can be found at http://www.gwydiondylan.org/~andreas/gcc-bug.c
Comment 1 andreas 2003-09-29 09:43:55 UTC
Created attachment 4858 [details]
Self-contained file triggering the bug.
Comment 2 Andrew Pinski 2003-09-29 15:47:49 UTC
I can confirm this on the mainline (20030929) and 3.3.1 (20030707).
This code did not produce an ICE in 3.2.3.
From Phil's regression hunter: Search converges between 2002-05-26-trunk (#79) and 2002-06
-02-trunk (#80).
Comment 3 Mark Mitchell 2003-10-16 09:35:02 UTC
Postponed until GCC 3.3.3.
Comment 4 roger 2003-12-07 05:53:24 UTC
For mainline, -fnew-ra may be used as a work-around.
Comment 5 Eric Botcazou 2003-12-12 08:34:50 UTC
I think that reload problems of this kind are not safely fixable on a release
branch.
Comment 6 Andrew Pinski 2003-12-30 17:41:00 UTC
*** Bug 13514 has been marked as a duplicate of this bug. ***
Comment 7 CVS Commits 2004-01-09 02:31:45 UTC
Subject: Bug 12441

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	rth@gcc.gnu.org	2004-01-09 02:31:41

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

Log message:
	PR opt/12441
	Revert: Sat Mar 30 14:08:55 CET 2002  Jan Hubicka  <jh@suse.cz>
	* i386.c (aligned_operand): Be prepared for SUBREGed registers.
	(ix86_decompose_address): Use REG_P instead of GET_CODE (...) == REG.
	(ix86_address_cost): Be prepared for SUBREGed registers.
	(legitimate_address_p): Accept SUBREGed registers.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.2194&r2=2.2195
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/i386.c.diff?cvsroot=gcc&r1=1.632&r2=1.633

Comment 8 Richard Henderson 2004-01-09 02:41:42 UTC
http://gcc.gnu.org/ml/gcc-patches/2004-01/msg00628.html
Comment 9 CVS Commits 2004-01-09 14:26:59 UTC
Subject: Bug 12441

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	hammer-3_3-branch
Changes by:	hubicka@gcc.gnu.org	2004-01-09 14:26:56

Modified files:
	gcc            : ChangeLog.hammer 
	gcc/config/i386: i386.c 

Log message:
	Backport from mainline.
	PR opt/12441
	Revert: Sat Mar 30 14:08:55 CET 2002  Jan Hubicka  <jh@suse.cz>
	* i386.c (aligned_operand): Be prepared for SUBREGed registers.
	(ix86_decompose_address): Use REG_P instead of GET_CODE (...) == REG.
	(ix86_address_cost): Be prepared for SUBREGed registers.
	(legitimate_address_p): Accept SUBREGed registers.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.hammer.diff?cvsroot=gcc&only_with_tag=hammer-3_3-branch&r1=1.1.2.255&r2=1.1.2.256
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/i386.c.diff?cvsroot=gcc&only_with_tag=hammer-3_3-branch&r1=1.490.2.63&r2=1.490.2.64

Comment 10 Andrew Pinski 2004-01-09 16:52:23 UTC
Fixed also for 3.3.3.
Comment 11 Eric Botcazou 2004-01-09 16:57:49 UTC
Not yet.
Comment 12 CVS Commits 2004-01-12 09:03:14 UTC
Subject: Bug 12441

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-branch
Changes by:	doko@gcc.gnu.org	2004-01-12 09:02:56

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

Log message:
	2004-01-12  Matthias Klose  <doko@debian.org>
	
	Backport from mainline
	
	2004-01-11  Richard Henderson  <rth@redhat.com>
	PR opt/12441
	Revert: Sat Mar 30 14:08:55 CET 2002  Jan Hubicka  <jh@suse.cz>
	* i386.c (aligned_operand): Be prepared for SUBREGed registers.
	(ix86_decompose_address): Use REG_P instead of GET_CODE (...) == REG.
	(ix86_address_cost): Be prepared for SUBREGed registers.
	(legitimate_address_p): Accept SUBREGed registers.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/i386.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.495.2.29&r2=1.495.2.30
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.16114.2.874&r2=1.16114.2.875

Comment 13 Andrew Pinski 2004-01-12 14:18:37 UTC
Fixed now for 3.3.3.