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

Steve Kargl wrote:
On Thu, Sep 07, 2006 at 09:42:32PM -0700, Jerry DeLisle wrote:
Andrew Pinski wrote:
There was some previous discussion about this problem in:

I forgot what the outcome of the discussion was.

Andrew Pinski


This is a very interesting thread to read and brings up some old arguments. I would like to put in my two cents worth. The thread discusses consequences of the ABS() intrinsic.

It's more than just abs(). It is technically illegal to do

i = - huge() - 1
call foo(i)      ! foo is compiled into some library

subroutine foo(i)
  i = -i
end subroutine

If gfortran were to support asymmetrical integers then the ABS intrinsic should throw a runtime error on ABS(most_negative_value). It does not follow common sense or good reasoning to have an incorrect result and to do so knowingly.

To avoid the runtime penalty in computations of checking for that absurd case, I think its better to just not allow it and stick with the standard which defines symmetrical integers.

The above is an enormous runtime penalty because you will
need to range check every single operation. Note the range
checking that I'm fixing is the constant folding in
only the front end. During runtime you will get the usual overflow wrap-around (again, twos compliment).

I think you said what I was trying to say. Run time penalty we can not afford, but at compile time checking constants appropriately to the standard. I think your explanation to Andrew of what you are doing clarifies very well.


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