re PR fortran/30381 ([4.1 only] ISHFTC() constant folding is broken.)
commitf1dcb9bf3b6a96a117836e6787fa4d49c87ad995
authorBrooks Moses <brooks.moses@codesourcery.com>
Wed, 10 Jan 2007 05:46:13 +0000 (10 05:46 +0000)
committerBrooks Moses <brooks@gcc.gnu.org>
Wed, 10 Jan 2007 05:46:13 +0000 (9 21:46 -0800)
tree23ccb0abe794245c81bad05c2acfc7144098c78a
parente1f1d97f19dc76735e2a6ac743ee31e545264969
re PR fortran/30381 ([4.1 only] ISHFTC() constant folding is broken.)

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.

From-SVN: r120634
gcc/fortran/ChangeLog
gcc/fortran/simplify.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/chkbits.f90
gcc/testsuite/gfortran.dg/ishft_1.f90 [moved from gcc/testsuite/gfortran.dg/ishft.f90 with 100% similarity]
gcc/testsuite/gfortran.dg/ishft_2.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/ishft_3.f90 [new file with mode: 0644]