This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/30420] 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 05:46:24 -0000
- Subject: [Bug fortran/30420] IBCLR() fails to properly handle clearing the sign bit.
- References: <bug-30420-13350@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from brooks at gcc dot gnu dot org 2007-01-10 05:46 -------
Subject: Bug 30420
Author: brooks
Date: Wed Jan 10 05:46:13 2007
New Revision: 120634
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=120634
Log:
PR 30381
PR 30420
* fortran/simplify.c (convert_mpz_to_unsigned): New function.
(convert_mpz_to_signed): New function, largely based on
twos_complement().
(twos_complement): Removed.
(gfc_simplify_ibclr): Add conversions to and from an
unsigned representation before bit-twiddling.
(gfc_simplify_ibset): Same.
(gfc_simplify_ishftc): Add checks for overly large
constant arguments, only check the third argument if
it's present, carry over high bits into the result as
appropriate, and perform the final conversion back to
a signed representation using the correct sign bit.
(gfc_simplify_not): Removed unnecessary masking.
* testsuite/gfortran.dg/
* chkbits.f90: Added IBCLR tests; test calls for
different integer kinds.
* ishft.f90: Renamed to ishft_1.f90...
* ishft_1.f90: ...Renamed from ishft.f90.
* ishft_2.f90: New test.
* ishft_3.f90: New test.
Added:
trunk/gcc/testsuite/gfortran.dg/ishft_1.f90
- copied unchanged from r120594,
trunk/gcc/testsuite/gfortran.dg/ishft.f90
trunk/gcc/testsuite/gfortran.dg/ishft_2.f90
trunk/gcc/testsuite/gfortran.dg/ishft_3.f90
Removed:
trunk/gcc/testsuite/gfortran.dg/ishft.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/simplify.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gfortran.dg/chkbits.f90
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30420