This is the mail archive of the 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 Fri, Sep 08, 2006 at 12:20:15AM -0700, Brooks Moses wrote:
> Jakub Jelinek wrote:
> >On Thu, Sep 07, 2006 at 04:53:54PM -0700, Steve Kargl wrote:
> >>The attached patch fixes 2 problems in the libgomp testsuite.
> >>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.
> >
> >>--- libgomp/testsuite/libgomp.fortran/reduction4.f90	(revision 116723)
> >>+++ libgomp/testsuite/libgomp.fortran/reduction4.f90	(working copy)
> >>@@ -12,7 +12,7 @@
> >>  ka = Z'05a5a5'
> >>  v = .false.
> >>  cnt = -1
> >>-  x = Z'ffffffff'
> >>+  x = - huge(x) - 1
> >
> >This can't be right.  The test really needs an integer with all bits set,
> >-huge(x) - 1 is Z'80000000'.  That's what the OpenMP standard mandates
> >that iand reduction var should be initialized to.
> Indeed.  This should be x=-1.  Or, possibly more clearly, x=not(0).
> (The BOZ-literal here is indeed wrong, but for a different reason; I 
> believe the official gfortran understanding is that such literals are 
> taken to be a _positive_ integer of the highest available precision, and 
> then type-cast upon assignment just like any other expression, so 
> nominally this is equivalent to x = 4294967295 and as such is illegal 
> due to integer overflow.)

You parenthetical statement is essentially true.  The
standard says something about BOZs are converted to
an integer where kind corresponds to the integer with
the largest decimal range.


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