Bug 14581 - [3.3/3.4/4.0 Regression] gcj internal error: Segmentation fault involving switch to a final var
Summary: [3.3/3.4/4.0 Regression] gcj internal error: Segmentation fault involving sw...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: java (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: 4.0.0
Assignee: Andrew Haley
URL:
Keywords: ice-on-invalid-code, patch
Depends on:
Blocks:
 
Reported: 2004-03-15 15:29 UTC by Andrew Haley
Modified: 2004-10-30 21:11 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work: 3.0.4
Known to fail: 3.2.3 3.3.1 3.4.0 4.0.0
Last reconfirmed: 2004-03-15 15:38:17


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Haley 2004-03-15 15:29:09 UTC
Larry Morell (morell@cs.atu.edu)

From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1)
Gecko/20030225

Description of problem:
Compiling:
class BugToken {
   public void oops () {
       final char eofSym;
       switch (7) {
          case eofSym    : ;
       }
   }

}

yields:
javac BugToken.java
BugToken.java: In class `BugToken':
BugToken.java: In method `BugToken.oops()':
BugToken.java:4: internal error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions.

Removing 'final' yields:


BugToken.java: In class `BugToken':
BugToken.java: In method `BugToken.oops()':
BugToken.java:5: Constant expression required.
             case eofSym    : ;
             ^
1 error

as hoped.

Version-Release number of selected component (if applicable):
gcc-3.2.2-5

How reproducible:
Always

Steps to Reproduce:
1. Using javac script supplied with Redhat 9 compile the program:class
BugToken {
   public void oops () {
       assinal char eofSym;
       switch (7) {
          case eofSym    : ;
       }
   }

}
   

Actual Results:  javac BugToken.java
BugToken.java: In class `BugToken':
BugToken.java: In method `BugToken.oops()':
BugToken.java:4: internal error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions.


Expected Results:  Should have compiled.
Comment 1 Andrew Pinski 2004-03-15 15:38:16 UTC
Confirmed, a regression from 3.0.4:
tin:~/src/gnu/gcctest>~/ia32_linux_gcc3_0/bin/gcj BugToken.java
BugToken.java: In class `BugToken':
BugToken.java: In method `BugToken.oops()':
BugToken.java:5: Constant expression required.
             case eofSym    : ;
             ^
1 error
Comment 2 Andrew Pinski 2004-03-15 15:41:33 UTC
Patch here: <http://gcc.gnu.org/ml/gcc/2004-03/msg00704.html>, looks like you posted it to the 
wrong lists.
Comment 3 GCC Commits 2004-03-15 17:56:18 UTC
Subject: Bug 14581

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	aph@gcc.gnu.org	2004-03-15 17:56:15

Modified files:
	gcc/java       : parse.y ChangeLog 

Log message:
	2004-03-15  Andrew Haley  <aph@redhat.com>
	
	PR java/14581
	* parse.y (java_complete_lhs): Check that final variable has an
	initializer.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/parse.y.diff?cvsroot=gcc&r1=1.472&r2=1.473
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/ChangeLog.diff?cvsroot=gcc&r1=1.1339&r2=1.1340

Comment 4 Andrew Haley 2004-03-15 17:58:08 UTC
.
Comment 5 GCC Commits 2004-04-13 20:27:17 UTC
Subject: Bug 14581

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-rhl-branch
Changes by:	jakub@gcc.gnu.org	2004-04-13 20:27:15

Modified files:
	gcc/java       : ChangeLog parse.y 

Log message:
	PR java/14581
	* parse.y (java_complete_lhs): Check that final variable has an
	initializer.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-rhl-branch&r1=1.1093.2.40.2.7&r2=1.1093.2.40.2.8
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/parse.y.diff?cvsroot=gcc&only_with_tag=gcc-3_3-rhl-branch&r1=1.405.2.10.2.2&r2=1.405.2.10.2.3

Comment 6 GCC Commits 2004-04-22 17:41:13 UTC
Subject: Bug 14581

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-rhl-branch
Changes by:	jakub@gcc.gnu.org	2004-04-22 17:40:58

Modified files:
	gcc/java       : ChangeLog parse.y 

Log message:
	2004-03-15  Andrew Haley  <aph@redhat.com>
	
	PR java/14581
	* parse.y (java_complete_lhs): Check that final variable has an
	initializer.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-rhl-branch&r1=1.1315.2.15&r2=1.1315.2.15.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/parse.y.diff?cvsroot=gcc&only_with_tag=gcc-3_4-rhl-branch&r1=1.464.4.2&r2=1.464.4.2.2.1