This is the mail archive of the
mailing list for the GCC project.
Re: Fix libgomp Fortran tests
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
i = -i
> 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).