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: Fix libgomp Fortran tests


On Thu, Sep 07, 2006 at 08:20:22PM -0600, Roger Sayle wrote:
> 
> 
> On Thu, 7 Sep 2006, Steve Kargl wrote:
> > The Fortran tried to use the most negative integer value, but
> > this cause an overflow because gfortran creates this value
> > via a unary minus operation.
> 
> Whilst I agree completely that prohibiting the constant -2147483648
> adheres to the letter of the standards, might it not be reasonable
> to support this as a STD_GNU or a STD_LEGACY extension for compatability
> with other compilers (such as previous versions of gfortran and g77)
> that are more forgiving in the constants that they accept.
> 
> I'm curious how many other F90/F95 compilers (dis)allow -2147483648?
> 
> Sorry if this has been discussed previously and just not referenced
> in your post: http://gcc.gnu.org/ml/gcc-patches/2006-08/msg01021.html
> 
> Just a thought,
> 

In my limited sampling of 1 other compiler (NAGWare), I find

laptop:kargl[230] cat > a.f90
integer :: i = -2147483648
print *, i
end
laptop:kargl[231] f95 -o z a.f90
Error: a.f90, line 1: Integer literal 2147483648 too large for default KIND
Errors in declarations, no further processing for $main$
[f95 error termination]

I have no other data points.

-- 
Steve


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