Summary: | ICE in force_evaluation_order() on valid code | ||
---|---|---|---|
Product: | gcc | Reporter: | Bryce McKinlay <bryce> |
Component: | java | Assignee: | Tom Tromey <tromey> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | gcc-bugs, green, java-prs |
Priority: | P2 | Keywords: | ice-on-valid-code, patch, wrong-code |
Version: | 4.0.0 | ||
Target Milestone: | 4.0.0 | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | 4.0.0 3.3.4 3.4.2 | Last reconfirmed: | 2004-07-27 20:54:07 |
Bug Depends on: | |||
Bug Blocks: | 17574 |
Description
Bryce McKinlay
2004-07-27 20:48:23 UTC
Crash.java: In class `Crash': Crash.java: In method `Crash.main(java.lang.String[])': Crash.java:5: error: Keyword `this' used outside allowed context. System.out.println(Thread.currentThread().holdsLock(this)); ^ 1 error This is the code which ICE: public class Crash { public void main(String[] args) { System.out.println(Thread.currentThread().holdsLock(this)); } } Andrew's version of the test case is correct. "static" should be removed. public class Crash { public void foo() { System.out.println(Thread.currentThread().holdsLock(this)); } } Lets look at the code: 3190 arg = TREE_OPERAND (node, 0); 3191 3192 arg = TREE_OPERAND (arg, 1); 3193 3194 /* Not having a list of argument here is an error. */ 3195 if (TREE_CODE (arg) != TREE_LIST) 3196 abort (); This is wrong when there is no arguments to the function which is true for currentThread. I'm not so sure. The fact that invalid bytecode is generated (bytecode compilation doesnt call force_evalution_order) leads me to suspect that something wen't wrong earlier. I'm testing a patch for this. *** Bug 15475 has been marked as a duplicate of this bug. *** Patch here: <http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02134.html>. Also this fixes the wrong-code with byte-code output. Subject: Bug 16789 CVSROOT: /cvs/gcc Module name: gcc Changes by: tromey@gcc.gnu.org 2004-09-24 15:39:17 Modified files: gcc/java : ChangeLog parse.y expr.c Log message: PR java/16789: * parse.y (resolve_qualified_expression_name): Set CAN_COMPLETE_NORMALLY on first call when chaining static calls. * expr.c (force_evaluation_order): Check for empty argument list after stripping COMPOUND_EXPR. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/ChangeLog.diff?cvsroot=gcc&r1=1.1461&r2=1.1462 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/parse.y.diff?cvsroot=gcc&r1=1.508&r2=1.509 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/expr.c.diff?cvsroot=gcc&r1=1.204&r2=1.205 Subject: Bug 16789 CVSROOT: /cvs/gcc Module name: gcc Changes by: tromey@gcc.gnu.org 2004-09-24 15:41:17 Modified files: libjava : ChangeLog Added files: libjava/testsuite/libjava.lang: pr16789.java pr16789.out Log message: PR java/16789: * testsuite/libjava.lang/pr16789.out: New file. * testsuite/libjava.lang/pr16789.java: New file. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/ChangeLog.diff?cvsroot=gcc&r1=1.3087&r2=1.3088 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/testsuite/libjava.lang/pr16789.java.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/testsuite/libjava.lang/pr16789.out.diff?cvsroot=gcc&r1=NONE&r2=1.1 Fix checked in. |