[gfortran,patch] FPE options, once again

Paul Brook paul@codesourcery.com
Thu Sep 8 16:50:00 GMT 2005


On Thursday 01 September 2005 21:46, FX Coudert wrote:
> This is the new version of the FPE patch for gfortran, using
> glibc-specific code on systems where it is available, and runtime
> detection of SSE units.
>
> I think the code itself is now in pretty good shape, although i'm a bit
> worried of having heard no word from other gfortran developpers about
> things such as the option name and the need/convenience of having
> environment variables.

I thought the last time this was discussed (for a different option), the 
conclusion was that environment variables were more trouble that they were 
worth. Applications are liable to mysteriously break because a user didn't 
have the exact same combination of magic environment variables set.

My preference is for a commandline switch (like you implemented), and maybe a 
new intrinsic procedure so an application can control the setting at runtime.

> Regtested on i686-linux. Testing in progress on i686-freebsd,
> x86_64-linux and i386-openbsd (no glibc, no SSE).
>
> OK for mainline? Do we want this on 4.0?

> +  int invalid = exceptions & 0x01;
> +  int denormal = exceptions & 0x02;
> +  int zero = exceptions & 0x04;
> +  int overflow = exceptions & 0x08;
> +  int underflow = exceptions & 0x10;
> +  int precision = exceptions & 0x20;
>...
> +  gfc_option.fpe_invalid = 0;
> +  gfc_option.fpe_denormal = 0;
> +  gfc_option.fpe_zero = 0;
> +  gfc_option.fpe_overflow = 0;
> +  gfc_option.fpe_underflow = 0;
> +  gfc_option.fpe_precision = 0;
>[etc]

I agree with RTHs comment that there's no point having all there as separate 
variables. We convert to/from a bitmap anyway, so we may as well just use 
that bitmap all the time. Also make the bitmasks into #defines so we don't 
have hardcoded values in multiple places.

Paul



More information about the Gcc-patches mailing list