From owner-cvs-ports@FreeBSD.ORG Sat Oct 16 17:16:40 2004 Return-Path: Delivered-To: cvs-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5D79D16A4CE; Sat, 16 Oct 2004 17:16:40 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4BC2143D2D; Sat, 16 Oct 2004 17:16:40 +0000 (GMT) (envelope-from glewis@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i9GHGeHj022387; Sat, 16 Oct 2004 17:16:40 GMT (envelope-from glewis@repoman.freebsd.org) Received: (from glewis@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i9GHGeaH022386; Sat, 16 Oct 2004 17:16:40 GMT (envelope-from glewis) Message-Id: <200410161716.i9GHGeaH022386@repoman.freebsd.org> From: Greg Lewis Date: Sat, 16 Oct 2004 17:16:40 +0000 (UTC) To: ports-committers@FreeBSD.org, cvs-ports@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: ports/java/jdk14/files patch-interpreter_bytecodes.hpp X-BeenThere: cvs-ports@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2004 17:16:40 -0000 glewis 2004-10-16 17:16:40 UTC FreeBSD ports repository Added files: java/jdk14/files patch-interpreter_bytecodes.hpp Log: . Fix the Server VM for gcc 3.4 part 2/2. The HotSpot code (ab)uses named enums as ints in a number of places. The problem with this is that according the the C++ spec, the compiler (essentially) only needs to use an integral type wide enough to hold the values defined in the enum. Earlier versions of gcc appear to have just used an int whether they could have got away with a narrower type or not, hence the code worked as expected. gcc 3.4 now appears to implement this part of the spec, so using an enum blindly as an int causes various problems due to overflow. In this case the enum, Bytecodes::Code, appears to be a genuine enum, its just assumed to be wide enough to hold an arbitrary int in various places in the code. The correct fix would be to track down all those places in the code and fix them. Since there are quite a lot of these places and 5.3 is close to release for now we just add a value to the enum set to INT_MAX, forcing the compiler to use at least an int for the type. Sleuth work, discussion and code suggestions: peadar Revision Changes Path 1.1 +24 -0 ports/java/jdk14/files/patch-interpreter_bytecodes.hpp (new)