This is the mail archive of the
java-prs@gcc.gnu.org
mailing list for the Java project.
[Bug java/22166] New: 0x80000000/-1 is wrong
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: java-prs at gcc dot gnu dot org
- Date: 23 Jun 2005 16:06:01 -0000
- Subject: [Bug java/22166] New: 0x80000000/-1 is wrong
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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