This is the mail archive of the gcc-patches@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]

Re: [patch, fortran] PR 30381, PR 30420: Fix constant-folding in bitwise intrinsics


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


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