Bug 13824 - [3.3 Regression] gcj SEGV with simple .java program
Summary: [3.3 Regression] gcj SEGV with simple .java program
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: java (show other bugs)
Version: 4.0.0
: P2 critical
Target Milestone: 3.3.3
Assignee: roger
URL:
Keywords: ice-on-valid-code, patch
Depends on:
Blocks:
 
Reported: 2004-01-23 02:48 UTC by Tom Tromey
Modified: 2004-01-29 19:02 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work: 3.2.3
Known to fail:
Last reconfirmed: 2004-01-23 03:00:04


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Tromey 2004-01-23 02:48:43 UTC
public class pr13107_3
{
  public static void main(String[] args)
  {
    for (int i = 0; i < 1; i++)
      {
	try {
	  System.out.println(i);
	}
	finally {
	  if (i == 3)
	    continue;
	}
      }
  }
}


This will be in the libgcj test suite shortly.
This fails with a SEGV when compiled to native with "-c -O3".
It correctly compiles to bytecode.
Comment 1 Andrew Pinski 2004-01-23 03:00:03 UTC
Confirmed for 3.3, 3.4, and 3.5, this is a regression from 3.2.3.

The problem is in unsafe_for_reeval somehow with a tree of LABELED_BLOCK_EXPR.
Comment 2 roger 2004-01-25 22:21:20 UTC
Patch here: http://gcc.gnu.org/ml/gcc-patches/2004-01/msg02759.html
Comment 3 Gabriel Dos Reis 2004-01-29 13:13:33 UTC
(In reply to comment #2)
> Patch here: http://gcc.gnu.org/ml/gcc-patches/2004-01/msg02759.html

Roger,

  Please apply for your proposed solution to 3.3.3.  It looks safe
to me.
Comment 4 GCC Commits 2004-01-29 17:13:27 UTC
Subject: Bug 13824

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	sayle@gcc.gnu.org	2004-01-29 17:13:21

Modified files:
	gcc            : ChangeLog tree.c 

Log message:
	PR java/13824
	* tree.c (unsafe_for_reeval): Handle EXIT_BLOCK_EXPR nodes specially
	as their EXIT_BLOCK_LABELED_BLOCK operands can lead to unbounded
	recursion.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.2552&r2=2.2553
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree.c.diff?cvsroot=gcc&r1=1.342&r2=1.343

Comment 5 GCC Commits 2004-01-29 18:24:48 UTC
Subject: Bug 13824

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	sayle@gcc.gnu.org	2004-01-29 18:24:44

Modified files:
	gcc            : ChangeLog tree.c 

Log message:
	PR java/13824
	* tree.c (unsafe_for_reeval): Handle EXIT_BLOCK_EXPR nodes specially
	as their EXIT_BLOCK_LABELED_BLOCK operands can lead to unbounded
	recursion.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.99&r2=2.2326.2.100
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.342&r2=1.342.2.1

Comment 6 Andrew Pinski 2004-01-29 18:32:31 UTC
Fixed for 3.4 and 3.5.
Comment 7 GCC Commits 2004-01-29 18:58:24 UTC
Subject: Bug 13824

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-branch
Changes by:	sayle@gcc.gnu.org	2004-01-29 18:58:16

Modified files:
	gcc            : ChangeLog tree.c 

Log message:
	PR java/13824
	* tree.c (unsafe_for_reeval): Handle EXIT_BLOCK_EXPR nodes specially
	as their EXIT_BLOCK_LABELED_BLOCK operands can lead to unbounded
	recursion.

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.895&r2=1.16114.2.896
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.282.2.5&r2=1.282.2.6

Comment 8 Andrew Pinski 2004-01-29 19:02:31 UTC
Fixed for 3.3.3.