From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9952 invoked by alias); 9 Aug 2004 05:23:23 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 9834 invoked by uid 48); 9 Aug 2004 05:23:22 -0000 Date: Mon, 09 Aug 2004 05:23:00 -0000 From: "fw at deneb dot enyo dot de" To: gcc-bugs@gcc.gnu.org Message-ID: <20040809052316.16927.fw@deneb.enyo.de> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug java/16927] New: assert statement fails at -O1 and above X-Bugzilla-Reason: CC X-SW-Source: 2004-08/txt/msg00622.txt.bz2 List-Id: The following class cannot be compiled at optimization levels -O1 and above: public class AssertBug { public void bug(Integer i) { assert(i.intValue() == 0): i.toString() + "!"; } } /tmp/AssertBug.java: In class `AssertBug': /tmp/AssertBug.java: In method `AssertBug.bug(java.lang.Integer)': /tmp/AssertBug.java:3: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See for instructions. The crash occurs at /home/fw/src/gnu/gcc/gcc/java/check-init.c:879: 874 case EXPR_WITH_FILE_LOCATION: 875 { 876 location_t saved_location = input_location; 877 tree saved_wfl = wfl; 878 tree body = EXPR_WFL_NODE (exp); 879 if (IS_EMPTY_STMT (body)) 880 break; 881 wfl = exp; 882 input_filename = EXPR_WFL_FILENAME (exp); 883 input_line = EXPR_WFL_LINENO (exp); The tree at exp seems to look like this: arg 2 >> chain > arg 1 side-effects tree_6 arg 0 side-effects arg 0 arg 1 arg 2 > arg 1 side-effects readonly invariant arg 0 >>>> chain arg 1 constant invariant arg 0 >>>>>>> -- Summary: assert statement fails at -O1 and above Product: gcc Version: 3.5.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: java AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: fw at deneb dot enyo dot de CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu dot org GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16927