From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2040 invoked by alias); 23 Jun 2005 16:06:03 -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 2016 invoked by uid 48); 23 Jun 2005 16:06:01 -0000 Date: Thu, 23 Jun 2005 16:06:00 -0000 From: "pinskia at gcc dot gnu dot org" To: java-prs@gcc.gnu.org Message-ID: <20050623160559.22166.pinskia@gcc.gnu.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug java/22166] New: 0x80000000/-1 is wrong X-Bugzilla-Reason: CC X-SW-Source: 2005-q2/txt/msg00831.txt.bz2 List-Id: The following code should work on not throw a NPE or any other kind of exception (or abort): public class t { public static void main(String[] a) { int i = -1; int j = (0x80000000); int k = j/i; // int k1 = j/i; System.out.println("k = "+k); } } Using -fuse-divide-subroutine makes this work correctly. -- Summary: 0x80000000/-1 is wrong Product: gcc Version: 4.1.0 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P2 Component: java AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pinskia at gcc dot gnu dot org CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu dot org GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22166