[Bug java/22166] 0x80000000/-1 is wrong in java
--- Additional Comments From pinskia at gcc dot gnu dot org 2005-09-17 03:27 --- Fixed for 4.1. -- What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED Target Milestone|--- |4.1.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22166
[Bug java/22166] 0x80000000/-1 is wrong in java
--- Additional Comments From falk at debian dot org 2005-08-30 19:14 --- (In reply to comment #3) > Actually, this looks like a more generic problem, not limited to Java. In C, signed overflow is undefined, so any result or behavior would be acceptable. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22166
[Bug java/22166] 0x80000000/-1 is wrong in java
--- 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 = 0x8000; 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
[Bug java/22166] 0x80000000/-1 is wrong in java
--- Additional Comments From rmathew at gcc dot gnu dot org 2005-08-30 07:33 --- Still exists on mainline. At optimisation levels 1,2 and 3, this bug disappears. Also disappears if "-fuse-divide-subroutine" is used. Seems to have been introduced between June 14th and 15th: http://gcc.gnu.org/ml/gcc-testresults/2005-06/msg00864.html http://gcc.gnu.org/ml/gcc-testresults/2005-06/msg00932.html -- What|Removed |Added Last reconfirmed|2005-08-05 04:09:29 |2005-08-30 07:33:27 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22166
[Bug java/22166] 0x80000000/-1 is wrong in java
-- What|Removed |Added Status|UNCONFIRMED |NEW Ever Confirmed||1 Last reconfirmed|-00-00 00:00:00 |2005-08-05 04:09:29 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22166
[Bug java/22166] 0x80000000/-1 is wrong in java
-- What|Removed |Added Summary|0x8000/-1 is wrong |0x8000/-1 is wrong in ||java http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22166