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.
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.
Patch here: http://gcc.gnu.org/ml/gcc-patches/2004-01/msg02759.html
(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.
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
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
Fixed for 3.4 and 3.5.
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
Fixed for 3.3.3.