From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 979 invoked by alias); 30 Aug 2005 09:13:34 -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 727 invoked by uid 48); 30 Aug 2005 09:13:26 -0000 Date: Tue, 30 Aug 2005 09:22:00 -0000 Message-ID: <20050830091326.726.qmail@sourceware.org> From: "rmathew at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20050623160559.22166.pinskia@gcc.gnu.org> References: <20050623160559.22166.pinskia@gcc.gnu.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug java/22166] 0x80000000/-1 is wrong in java X-Bugzilla-Reason: CC X-SW-Source: 2005-08/txt/msg03420.txt.bz2 List-Id: ------- Additional Comments From rmathew at gcc dot gnu dot org 2005-08-30 09:13 ------- Actually, this looks like a more generic problem, not limited to Java. Witness: ----------------------------------- 8< ----------------------------------- ~/src/tmp/PR22166 > cat x.c #include int main( void) { int i = 0x80000000; int j = -1; printf( "%u: %d\n", sizeof(int), i/j); return 0; } ~/src/tmp/PR22166 > mygcc --version xgcc (GCC) 4.1.0 20050830 (experimental) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ~/src/tmp/PR22166 > mygcc x.c ~/src/tmp/PR22166 > ./a.out Floating point exception ~/src/tmp/PR22166 > mygcc -O1 x.c ~/src/tmp/PR22166 > ./a.out 4: -2147483648 ~/src/tmp/PR22166 > ----------------------------------- 8< ----------------------------------- -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22166