From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2118 invoked by alias); 23 Jun 2005 16:06:05 -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 2011 invoked by uid 48); 23 Jun 2005 16:06:00 -0000 Date: Thu, 23 Jun 2005 16:06:00 -0000 From: "pinskia at gcc dot gnu dot org" To: gcc-bugs@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-06/txt/msg02945.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