This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch, fortran] PR 30381, PR 30420: Fix constant-folding in bitwise intrinsics
- From: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- To: Brooks Moses <brooks dot moses at codesourcery dot com>
- Cc: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Tue, 9 Jan 2007 21:28:10 -0800
- Subject: Re: [patch, fortran] PR 30381, PR 30420: Fix constant-folding in bitwise intrinsics
- References: <45A468FB.4000207@codesourcery.com>
On Tue, Jan 09, 2007 at 08:18:03PM -0800, Brooks Moses wrote:
>
> -----------------------------------------------------------
> 2007-01-09 Brooks Moses <brooks.moses@codesourcery.com>
>
> PR 30381
> PR 30420
> * 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.
>
> -----------------------------------------------------------
> 2007-01-09 Brooks Moses <brooks.moses@codesourcery.com>
>
> * 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.
>
OK with a few changes. In a few places you have error messages of the
form
+ gfc_error
+ ("Magnitude of second argument of ISHFTC exceeds third argument "
+ "at %L", &s->where);
Please unwrap this to
gfc_error ("Magnitude of second argument of ISHFTC exceeds third
"argument at %L", &s->where);
Try 'grep gfc_error *.c' to see my justification for the request.
I'm trying to migrate gfortran source code to a uniform style.
--
Steve