This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/30420] New: IBCLR() fails to properly handle clearing the sign bit.
- From: "brooks at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Jan 2007 02:09:53 -0000
- Subject: [Bug fortran/30420] New: IBCLR() fails to properly handle clearing the sign bit.
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Consider the following program:
program ibclr_test
write(*,*) ibclr(-1_1, 7)
end
This gives an error of:
write(*,*) ibclr(-1_1, 7)
1
Error: Result of IBCLR overflows its kind at (1)
The problem is that in the mpz_t representation, -1_1 is represented as a
string of 1 bits, and then when the 7th bit is swapped, this remains a negative
number -- but one that's out of range.
--
Summary: IBCLR() fails to properly handle clearing the sign bit.
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: rejects-valid
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: brooks at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30420