This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/30420] New: IBCLR() fails to properly handle clearing the sign bit.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]