diff options
author | Tom Horsley <tom@amber.ssd.hcsc.com> | 1997-07-30 13:24:15 +1200 |
---|---|---|
committer | Tim Bunce <Tim.Bunce@ig.co.uk> | 1997-08-07 00:00:00 +1200 |
commit | ef2d312d3309ac1c38d04eea6f4d58872505013a (patch) | |
tree | a305e86685aecdc665cb5f0370d175ebc36709f4 /pp.c | |
parent | d9fdd1afe4b88705294e21dc4e070c42d3d9a4d8 (diff) | |
download | perl-ef2d312d3309ac1c38d04eea6f4d58872505013a.tar.gz |
work around compiler bug on CX/UX (perl5.004_01)
This patch provides a work-around for a compiler bug on CX/UX systems (which
shows up as a failure in the 'w' format of pack). The
CXUX_BROKEN_CONSTANT_CONVERT ifdef flag is added to the hints/cxux.sh
compiler and pp.c is modified to avoid a compile time constant conversion
which fails based on that ifdef.
While I was in the hints file, I also added the magical
-Qtarget=M88110compat compiler option which makes it build code that will
run on both 88110 and 88100 CX/UX machines interchangably.
This patch was generated from a brand new copy of perl5.004_01, so I'm
confident there are no extraneous changes that slipped in. I even built
and tested and it passed all tests.
(I decided to go with option #3 in my previous mail about how to do the patch).
If its too late for 5.004_02, I wouldn't worry - it isn't very critical.
p5p-msgid: 9707301934.AA18594@amber.ssd.hcsc.com
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -16,6 +16,17 @@ #include "perl.h" /* + * The compiler on Concurrent CX/UX systems has a subtle bug which only + * seems to show up when compiling pp.c - it generates the wrong double + * precision constant value for (double)UV_MAX when used inline in the body + * of the code below, so this makes a static variable up front (which the + * compiler seems to get correct) and uses it in place of UV_MAX below. + */ +#ifdef CXUX_BROKEN_CONSTANT_CONVERT +static double UV_MAX_cxux = ((double)UV_MAX); +#endif + +/* * Types used in bitwise operations. * * Normally we'd just use IV and UV. However, some hardware and @@ -3714,8 +3725,12 @@ PP(pp_pack) #ifdef BW_BITS adouble <= BW_MASK #else +#ifdef CXUX_BROKEN_CONSTANT_CONVERT + adouble <= UV_MAX_cxux +#else adouble <= UV_MAX #endif +#endif ) { char buf[1 + sizeof(UV)]; |