Bug 11301 - [3.3/3.4 Regression] ICE with -fno-globals
Summary: [3.3/3.4 Regression] ICE with -fno-globals
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 3.3.1
: P1 critical
Target Milestone: 3.3.1
Assignee: Toon Moene
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2003-06-24 01:43 UTC by snyder
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-06-24 14:41:17


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description snyder 2003-06-24 01:43:05 UTC
g77 crashes when run with -fno-globals:

$ ./f771 -fno-globals x.f
 ssprt_ MAIN__f771: ../../gcc/gcc/f/com.c:13449: finish_decl: Assertion `((decl)->decl.initial) == (tree) ((void *)0)' failed.
x.f: In program `ssrun':

x.f:5: internal compiler error: Aborted
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
$


This crash seems to be related to this change:

2003-06-13  Richard Henderson  <rth@redhat.com>

        PR debug/9864
        * com.c (ffecom_sym_transform_): Install FFEINFO_whereGLOBAL
        symbols in the global binding level.


If i revert that patch, then the problem goes away.

Environment:
System: Linux shoreham-clued0 2.4.17-0.4XFS #1 Tue Mar 12 14:43:32 CST 2002 i686 unknown
Architecture: i686

	<machine, os, target, libraries (multiple lines)>
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../gcc/configure --prefix=/work/shoreham-clued0/snyder/gcc-3.3/inst --enable-threads=posix --enable-long-long --enable-languages=c,c++,f77 --disable-shared

How-To-Repeat:

Compile with -fno-globals:

----------------------------------------------------
      SUBROUTINE SSPRT
      END

      PROGRAM SSRUN
      CALL SSPRT
      END
----------------------------------------------------
Comment 1 snyder 2003-06-24 01:43:05 UTC
Fix:
	<how to correct or work around the problem, if known (multiple lines)>
Comment 2 snyder 2003-06-24 02:45:12 UTC
Subject: Re:  New: <synopsis of the problem (one line)>


The synopsis of that should have been `[3.3] -fno-globals broken'.
I apologize for the confusion.
sss
Comment 3 Andrew Pinski 2003-06-24 14:41:17 UTC
I can confirm this on 3.3.1 (20030616) and on the mainline (20030624) but I do 
not get an ICE on 3.2.3 so this is a regression.
Comment 4 Toon Moene 2003-07-05 08:22:18 UTC
See if I can squash this one ....

Toon Moene.
Comment 5 CVS Commits 2003-07-05 13:35:46 UTC
Subject: Bug 11301

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-branch
Changes by:	toon@gcc.gnu.org	2003-07-05 13:35:43

Modified files:
	gcc/f          : ChangeLog com.c 

Log message:
	2003-07-05  Toon Moene  <toon@moene.indiv.nluug.nl>
	
	PR Fortran/11301
	* com.c (ffecom_sym_transform_): Only install
	FFEINFO_whereGLOBAL symbols in the global binding
	level if not -fno-globals.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/f/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.503.2.27&r2=1.503.2.28
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/f/com.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.182.4.3&r2=1.182.4.4

Comment 6 CVS Commits 2003-07-05 13:37:41 UTC
Subject: Bug 11301

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	toon@gcc.gnu.org	2003-07-05 13:37:39

Modified files:
	gcc/f          : ChangeLog com.c 

Log message:
	2003-07-05  Toon Moene  <toon@moene.indiv.nluug.nl>
	
	PR Fortran/11301
	* com.c (ffecom_sym_transform_): Only install
	FFEINFO_whereGLOBAL symbols in the global binding
	level if not -fno-globals.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/f/ChangeLog.diff?cvsroot=gcc&r1=1.581&r2=1.582
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/f/com.c.diff?cvsroot=gcc&r1=1.208&r2=1.209

Comment 7 Toon Moene 2003-07-05 13:38:51 UTC
Fixed.

Toon Moene.
Comment 8 CVS Commits 2003-07-09 19:04:44 UTC
Subject: Bug 11301

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-branch
Changes by:	toon@gcc.gnu.org	2003-07-09 19:04:40

Modified files:
	gcc/f          : ChangeLog com.c 

Log message:
	2003-07-09  Toon Moene  <toon@moene.indiv.nluug.nl>
	
	PR Fortran/11301
	* com.c (ffecom_sym_transform_): finish_decl should have
	the same last argument as start_decl.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/f/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.503.2.29&r2=1.503.2.30
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/f/com.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.182.4.4&r2=1.182.4.5

Comment 9 CVS Commits 2003-07-09 21:13:08 UTC
Subject: Bug 11301

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	toon@gcc.gnu.org	2003-07-09 21:12:56

Modified files:
	gcc/f          : ChangeLog com.c 

Log message:
	2003-07-09  Toon Moene  <toon@moene.indiv.nluug.nl>
	
	PR Fortran/11301
	* com.c (ffecom_sym_transform_): finish_decl should have
	the same last argument as start_decl.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/f/ChangeLog.diff?cvsroot=gcc&r1=1.587&r2=1.588
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/f/com.c.diff?cvsroot=gcc&r1=1.211&r2=1.212