From: Jarkko Hietaniemi Date: Tue, 7 Aug 2001 23:35:27 +0000 (+0000) Subject: Ignore SIGFPE everywhere. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7014c40783484eed55bf735c99b9ec618f0b36dd;p=p5sagit%2Fp5-mst-13.2.git Ignore SIGFPE everywhere. p4raw-id: //depot/perl@11608 --- diff --git a/hints/os390.sh b/hints/os390.sh index 4f6f370..4eff5a8 100644 --- a/hints/os390.sh +++ b/hints/os390.sh @@ -25,8 +25,6 @@ case "$ld" in esac # -DMAXSIG=38 maximum signal number -# -DPERL_IGNORE_FPUSIG=SIGFPE allows Perl to be cavalier with FP overflow -# (particularly in numeric.c:S_mulexp10()) # -DOEMVS is used in place of #ifdef __MVS__ in certain places. # -D_OE_SOCKETS alters system headers. # -D_XOPEN_SOURCE_EXTENDEDA alters system headers. @@ -35,8 +33,8 @@ esac # -DEBCDIC should come from Configure and need not be mentioned here. # Prepend your favorites with Configure -Dccflags=your_favorites case "$ccflags" in -'') ccflags='-DMAXSIG=38 -DPERL_IGNORE_FPUSIG=SIGFPE -DOEMVS -D_OE_SOCKETS -D_XOPEN_SOURCE_EXTENDED -D_ALL_SOURCE -DYYDYNAMIC' ;; -*) ccflags="$ccflags -DMAXSIG=38 -DPERL_IGNORE_FPUSIG=SIGFPE -DOEMVS -D_OE_SOCKETS -D_XOPEN_SOURCE_EXTENDED -D_ALL_SOURCE -DYYDYNAMIC" ;; +'') ccflags='-DMAXSIG=38 -DOEMVS -D_OE_SOCKETS -D_XOPEN_SOURCE_EXTENDED -D_ALL_SOURCE -DYYDYNAMIC' ;; +*) ccflags="$ccflags -DMAXSIG=38 -DOEMVS -D_OE_SOCKETS -D_XOPEN_SOURCE_EXTENDED -D_ALL_SOURCE -DYYDYNAMIC" ;; esac # Turning on optimization breaks perl. diff --git a/hints/posix-bc.sh b/hints/posix-bc.sh index f844525..a7d3d2c 100644 --- a/hints/posix-bc.sh +++ b/hints/posix-bc.sh @@ -19,9 +19,8 @@ esac # -DPOSIX_BC # -DUSE_PURE_BISON # -D_XOPEN_SOURCE_EXTENDED alters system headers. -# -DPERL_IGNORE_FPUSIG=SIGFPE # Prepend your favorites with Configure -Dccflags=your_favorites -ccflags="$ccflags -Kenum_long,llm_case_lower,llm_keep,no_integer_overflow -DPOSIX_BC -DUSE_PURE_BISON -D_XOPEN_SOURCE_EXTENDED -DPERL_IGNORE_FPUSIG=SIGFPE" +ccflags="$ccflags -Kenum_long,llm_case_lower,llm_keep,no_integer_overflow -DPOSIX_BC -DUSE_PURE_BISON -D_XOPEN_SOURCE_EXTENDED" # ccdlflags have yet to be determined. #case "$ccdlflags" in diff --git a/hints/uts.sh b/hints/uts.sh index 74bedbd..eb0d78c 100644 --- a/hints/uts.sh +++ b/hints/uts.sh @@ -1,7 +1,7 @@ archname='s390' archobjs='uts/strtol_wrap.o uts/sprintf_wrap.o' cc='cc -Xa' -ccflags='-XTSTRINGS=1500000 -DStrtol=strtol_wrap32 -DStrtoul=strtoul_wrap32 -DPERL_IGNORE_FPUSIG=SIGFPE -DSPRINTF_E_BUG' +ccflags='-XTSTRINGS=1500000 -DStrtol=strtol_wrap32 -DStrtoul=strtoul_wrap32 -DSPRINTF_E_BUG' cccdlflags='-pic' d_bincompat3='undef' d_csh='undef' diff --git a/numeric.c b/numeric.c index 8d94975..68c1671 100644 --- a/numeric.c +++ b/numeric.c @@ -572,24 +572,12 @@ S_mulexp10(NV value, I32 exponent) negative = 1; exponent = -exponent; } -#ifdef __VAX /* avoid %SYSTEM-F-FLTOVF_F sans VAXC$ESTABLISH */ -# if defined(__DECC_VER) && __DECC_VER <= 50390006 - /* __F_FLT_MAX_10_EXP - 5 == 33 */ - if (!negative && - (log10(value) + exponent) >= (__F_FLT_MAX_10_EXP - 5)) - return NV_MAX; -# endif -#endif -#if defined(__alpha) && defined(__unix__) - if (!negative && - (log10(value) + exponent) >= (DBL_MAX_10_EXP)) - return NV_INF; -#endif for (bit = 1; exponent; bit <<= 1) { if (exponent & bit) { exponent ^= bit; result *= power; } + /* Floating point exceptions are supposed to be turned off. */ power *= power; } return negative ? value / result : value * result; diff --git a/perl.h b/perl.h index b85b88f..8269448 100644 --- a/perl.h +++ b/perl.h @@ -1754,10 +1754,12 @@ typedef struct ptr_tbl PTR_TBL_t; # include # endif # define PERL_FPU_INIT fpsetmask(0); -# elif PERL_IGNORE_FPUSIG -# define PERL_FPU_INIT signal(PERL_IGNORE_FPUSIG, SIG_IGN); # else -# define PERL_FPU_INIT +# if defined(SIGFPE) && defined(SIG_IGN) +# define PERL_FPU_INIT signal(SIGFPE, SIG_IGN); +# else +# define PERL_FPU_INIT +# endif # endif #endif