From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7853 invoked by alias); 24 Jul 2004 20:52:35 -0000 Mailing-List: contact java-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-prs-owner@gcc.gnu.org Received: (qmail 7838 invoked by uid 48); 24 Jul 2004 20:52:34 -0000 Date: Sat, 24 Jul 2004 20:52:00 -0000 From: "suvarov454 at users dot sourceforge dot net" To: java-prs@gcc.gnu.org Message-ID: <20040724205233.16701.suvarov454@users.sourceforge.net> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug java/16701] New: GCJ inlines private constants into other classes X-Bugzilla-Reason: CC X-SW-Source: 2004-q3/txt/msg00104.txt.bz2 List-Id: I get a compile error when a class uses a public constant from a different class, which is initialized with the value of a private constant, which is (in turn) based on the value of another private constant. When I use the Sun, MicroSoft, Eclipse, or jikes compilers, it compiles fine. With GCJ, it says that the first class is attempting to access a private member of the second. This error appears in both GCJ 3.3.4 (gcj-3.3 from Debian Sarge) and in the "java-gui-branch" of GCJ 3.5. I use ".../gcj -C *.java" to compile to CLASS files. The error from v3.5 is: Coords.java: In class `TestCoords': Coords.java: In method `TestCoords.main(java.lang.String[])': Coords.java:50: error: Can't access private field `Coords.MASK' from `TestCoords'. Integer.MAX_VALUE & Coords.MASK; ^ 1 error The error from v3.3.4 is: Coords.java: In class `TestCoords': Coords.java: In method `TestCoords.main(java.lang.String[])': Coords.java:50: error: Can't access private field `Coords.MASK' from `TestCoords'. Integer.MAX_VALUE & Coords.MASK; ^ Coords.java:56: error: Can't access private field `Coords.SHIFT' from `TestCoords'. ( Integer.MAX_VALUE - Coords.MAX_BOARD_HEIGHT ) >> Coords.SHIFT; ^ 2 errors I've attached the two source files below. -- Summary: GCJ inlines private constants into other classes Product: gcc Version: 3.5.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: java AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: suvarov454 at users dot sourceforge dot net 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=16701