Bug 13060 - [3.3/3.4 Regression] [g77] ICE in fixup_var_refs_1, at function.c:1947 on correct code with "-O2 -fno-force-mem"
Summary: [3.3/3.4 Regression] [g77] ICE in fixup_var_refs_1, at function.c:1947 on cor...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 3.3.2
: P2 normal
Target Milestone: 3.3.3
Assignee: Eric Botcazou
URL:
Keywords: ice-on-valid-code, patch
Depends on:
Blocks:
 
Reported: 2003-11-15 12:26 UTC by Kirill Smelkov
Modified: 2004-01-17 04:22 UTC (History)
1 user (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-12-02 15:57:12


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kirill Smelkov 2003-11-15 12:26:34 UTC
--- geo2.f --- 
c   g77 -c -O2 -fno-force-mem geo2.f 
c   geo2.f: In subroutine `geo2': geo2.f:13: internal compiler error: in fixup_var_refs_1, at 
function.c:1947 
c   Please submit a full bug report, 
c   with preprocessed source if appropriate. 
c   See <URL:http://gcc.gnu.org/bugs.html> for instructions. 
 
      subroutine geo2() 
      implicit none 
 
      integer ms,n,ne(2) 
 
      ne(1) = 1 
      ne(2) = 2 
      ms = 1 
 
      call call_me(ne(1)*ne(1)) 
 
      n = ne(ms) 
      end 
--- geo2.f end--- 
 
[kirr@roro psi]$ g77 -v 
Reading specs from /mnt/tmini/kirr/local/gcc-3.3.2/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/specs 
Configured with: ../gcc-3.3.2/configure --prefix=/mnt/tmini/kirr/local/gcc-3.3.2 --with-gnu-as 
--with-gnu-ld --enable-threads=posix --enable-languages=c,c++,f77 --enable-checking 
--disable-nls 
Thread model: posix 
gcc version 3.3.2
Comment 1 Toon Moene 2003-11-15 12:55:27 UTC
Probably target specific, as I cannot reproduce it on powerpc-unknown-linux-gnu.
Comment 2 Andrew Pinski 2003-11-15 19:35:42 UTC
I can confirm this with the mainline and it is a regression from 2.95.3.
Comment 3 Eric Botcazou 2003-12-02 15:57:12 UTC
Confirmed with gcc version 3.3.3 20031129 (prerelease) at -O -fno-force-mem.
Comment 4 Eric Botcazou 2003-12-03 09:17:30 UTC
Investigating.
Comment 5 Eric Botcazou 2003-12-04 11:58:55 UTC
-O alone is sufficient to trigger the ICE since -fforce-mem is not enabled at -O.
Comment 6 Andrew Pinski 2003-12-06 11:56:53 UTC
Patch here: <http://gcc.gnu.org/ml/gcc-patches/2003-12/msg00628.html>.
Comment 7 GCC Commits 2003-12-07 12:52:02 UTC
Subject: Bug 13060

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	ebotcazou@gcc.gnu.org	2003-12-07 12:51:58

Modified files:
	gcc            : ChangeLog function.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g77.f-torture/compile: 13060.f 

Log message:
	PR optimization/13060
	* function.c (fixup_var_refs_1) [SUBREG]: Recognize even if a
	replacement already exists.  Fix again the whole insn if that fails.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.1943&r2=2.1944
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/function.c.diff?cvsroot=gcc&r1=1.473&r2=1.474
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3235&r2=1.3236
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g77.f-torture/compile/13060.f.diff?cvsroot=gcc&r1=NONE&r2=1.1

Comment 8 GCC Commits 2003-12-11 07:58:03 UTC
Subject: Bug 13060

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-branch
Changes by:	ebotcazou@gcc.gnu.org	2003-12-11 07:58:00

Modified files:
	gcc            : ChangeLog function.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g77.f-torture/compile: 13060.f 

Log message:
	Backport from mainline:
	
	2003-12-07  Eric Botcazou  <ebotcazou@libertysurf.fr>
	
	PR optimization/13060
	* function.c (fixup_var_refs_1) [SUBREG]: Recognize even if a
	replacement already exists.  Fix again the whole insn if that fails.

Patches:
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.837&r2=1.16114.2.838
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/function.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.389.2.12&r2=1.389.2.13
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.2261.2.329&r2=1.2261.2.330
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g77.f-torture/compile/13060.f.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.2.1

Comment 9 Eric Botcazou 2003-12-11 07:59:55 UTC
See the aforementioned link.