This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix libgomp Fortran tests
> > 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.
>
> But, if you restrict the set of permitted integer values to a symmetric
> set, then by that same logic (and application of 7.1.7, "The execution
> of any numeric operation whose result is not defined by the arithmetic
> used by the processor is prohibited."), the subtraction operator should
> throw a runtime error on HUGE(I)-1.
There is no requirement for a runtime error. The prohibition you mention above
is a requirement placed on the user writing the code, not the compiler.
The compiler is only required to diagnose constraint violations. It can do
whatever it wants with other illegal code. There are many restrictions
specified by the standard that not possible or extremely inconvenient to
enforce with a hard error.
Paul