diff options
author | tkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-03-04 08:03:34 +0000 |
---|---|---|
committer | tkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-03-04 08:03:34 +0000 |
commit | a6f8dac9f4e73f6a816a784eb6a81cfe41c8fcae (patch) | |
tree | a61d8416540e00b4c26389a23d6836b40ab750f5 /libgfortran | |
parent | 608ae6a84a7e227cd5ef57728b949b5db9beed0c (diff) | |
download | gcc-a6f8dac9f4e73f6a816a784eb6a81cfe41c8fcae.tar.gz |
2007-03-04 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/30981
* m4/pow_m4: Use appropriate unsigned int type for u.
* generated/pow_c10_i16.c: Regenerated.
* generated/pow_c10_i4.c: Regenerated.
* generated/pow_c10_i8.c: Regenerated.
* generated/pow_c16_i16.c: Regenerated.
* generated/pow_c16_i4.c: Regenerated.
* generated/pow_c16_i8.c: Regenerated.
* generated/pow_c4_i16.c: Regenerated.
* generated/pow_c4_i4.c: Regenerated.
* generated/pow_c4_i8.c: Regenerated.
* generated/pow_c8_i16.c: Regenerated.
* generated/pow_c8_i4.c: Regenerated.
* generated/pow_c8_i8.c: Regenerated.
* generated/pow_i16_i16.c: Regenerated.
* generated/pow_i16_i4.c: Regenerated.
* generated/pow_i16_i8.c: Regenerated.
* generated/pow_i4_i16.c: Regenerated.
* generated/pow_i4_i4.c: Regenerated.
* generated/pow_i4_i8.c: Regenerated.
* generated/pow_i8_i16.c: Regenerated.
* generated/pow_i8_i4.c: Regenerated.
* generated/pow_i8_i8.c: Regenerated.
* generated/pow_r10_i16.c: Regenerated.
* generated/pow_r10_i4.c: Regenerated.
* generated/pow_r10_i8.c: Regenerated.
* generated/pow_r16_i16.c: Regenerated.
* generated/pow_r16_i4.c: Regenerated.
* generated/pow_r16_i8.c: Regenerated.
* generated/pow_r4_i16.c: Regenerated.
* generated/pow_r4_i4.c: Regenerated.
* generated/pow_r4_i8.c: Regenerated.
* generated/pow_r8_i16.c: Regenerated.
* generated/pow_r8_i4.c: Regenerated.
* generated/pow_r8_i8.c: Regenerated.
2007-03-04 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/30981
* gfortran.dg/integer_exponentiation_1.f90: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122522 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
35 files changed, 267 insertions, 93 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index cfa42b23db4..ad71a7e6b20 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,41 @@ +2007-03-04 Thomas Koenig <Thomas.Koenig@online.de> + + PR libfortran/30981 + * m4/pow_m4: Use appropriate unsigned int type for u. + * generated/pow_c10_i16.c: Regenerated. + * generated/pow_c10_i4.c: Regenerated. + * generated/pow_c10_i8.c: Regenerated. + * generated/pow_c16_i16.c: Regenerated. + * generated/pow_c16_i4.c: Regenerated. + * generated/pow_c16_i8.c: Regenerated. + * generated/pow_c4_i16.c: Regenerated. + * generated/pow_c4_i4.c: Regenerated. + * generated/pow_c4_i8.c: Regenerated. + * generated/pow_c8_i16.c: Regenerated. + * generated/pow_c8_i4.c: Regenerated. + * generated/pow_c8_i8.c: Regenerated. + * generated/pow_i16_i16.c: Regenerated. + * generated/pow_i16_i4.c: Regenerated. + * generated/pow_i16_i8.c: Regenerated. + * generated/pow_i4_i16.c: Regenerated. + * generated/pow_i4_i4.c: Regenerated. + * generated/pow_i4_i8.c: Regenerated. + * generated/pow_i8_i16.c: Regenerated. + * generated/pow_i8_i4.c: Regenerated. + * generated/pow_i8_i8.c: Regenerated. + * generated/pow_r10_i16.c: Regenerated. + * generated/pow_r10_i4.c: Regenerated. + * generated/pow_r10_i8.c: Regenerated. + * generated/pow_r16_i16.c: Regenerated. + * generated/pow_r16_i4.c: Regenerated. + * generated/pow_r16_i8.c: Regenerated. + * generated/pow_r4_i16.c: Regenerated. + * generated/pow_r4_i4.c: Regenerated. + * generated/pow_r4_i8.c: Regenerated. + * generated/pow_r8_i16.c: Regenerated. + * generated/pow_r8_i4.c: Regenerated. + * generated/pow_r8_i8.c: Regenerated. + 2007-03-03 Francois-Xavier Coudert <coudert@clipper.ens.fr> PR libfortran/31001 diff --git a/libgfortran/generated/pow_c10_i16.c b/libgfortran/generated/pow_c10_i16.c index 6332013bdbc..c62d5f47c22 100644 --- a/libgfortran/generated/pow_c10_i16.c +++ b/libgfortran/generated/pow_c10_i16.c @@ -45,7 +45,8 @@ GFC_COMPLEX_10 pow_c10_i16 (GFC_COMPLEX_10 a, GFC_INTEGER_16 b) { GFC_COMPLEX_10 pow, x; - GFC_INTEGER_16 n, u; + GFC_INTEGER_16 n; + GFC_UINTEGER_16 u; n = b; x = a; @@ -55,10 +56,13 @@ pow_c10_i16 (GFC_COMPLEX_10 a, GFC_INTEGER_16 b) if (n < 0) { - n = -n; + u = -n; x = pow / x; } - u = n; + else + { + u = n; + } for (;;) { if (u & 1) diff --git a/libgfortran/generated/pow_c10_i4.c b/libgfortran/generated/pow_c10_i4.c index ccb1a0c6a2b..aca3e7f1ad7 100644 --- a/libgfortran/generated/pow_c10_i4.c +++ b/libgfortran/generated/pow_c10_i4.c @@ -45,7 +45,8 @@ GFC_COMPLEX_10 pow_c10_i4 (GFC_COMPLEX_10 a, GFC_INTEGER_4 b) { GFC_COMPLEX_10 pow, x; - GFC_INTEGER_4 n, u; + GFC_INTEGER_4 n; + GFC_UINTEGER_4 u; n = b; x = a; @@ -55,10 +56,13 @@ pow_c10_i4 (GFC_COMPLEX_10 a, GFC_INTEGER_4 b) if (n < 0) { - n = -n; + u = -n; x = pow / x; } - u = n; + else + { + u = n; + } for (;;) { if (u & 1) diff --git a/libgfortran/generated/pow_c10_i8.c b/libgfortran/generated/pow_c10_i8.c index 0f2b2426481..a4a94526db4 100644 --- a/libgfortran/generated/pow_c10_i8.c +++ b/libgfortran/generated/pow_c10_i8.c @@ -45,7 +45,8 @@ GFC_COMPLEX_10 pow_c10_i8 (GFC_COMPLEX_10 a, GFC_INTEGER_8 b) { GFC_COMPLEX_10 pow, x; - GFC_INTEGER_8 n, u; + GFC_INTEGER_8 n; + GFC_UINTEGER_8 u; n = b; x = a; @@ -55,10 +56,13 @@ pow_c10_i8 (GFC_COMPLEX_10 a, GFC_INTEGER_8 b) if (n < 0) { - n = -n; + u = -n; x = pow / x; } - u = n; + else + { + u = n; + } for (;;) { if (u & 1) diff --git a/libgfortran/generated/pow_c16_i16.c b/libgfortran/generated/pow_c16_i16.c index a6d888369b2..d05580f71d6 100644 --- a/libgfortran/generated/pow_c16_i16.c +++ b/libgfortran/generated/pow_c16_i16.c @@ -45,7 +45,8 @@ GFC_COMPLEX_16 pow_c16_i16 (GFC_COMPLEX_16 a, GFC_INTEGER_16 b) { GFC_COMPLEX_16 pow, x; - GFC_INTEGER_16 n, u; + GFC_INTEGER_16 n; + GFC_UINTEGER_16 u; n = b; x = a; @@ -55,10 +56,13 @@ pow_c16_i16 (GFC_COMPLEX_16 a, GFC_INTEGER_16 b) if (n < 0) { - n = -n; + u = -n; x = pow / x; } - u = n; + else + { + u = n; + } for (;;) { if (u & 1) diff --git a/libgfortran/generated/pow_c16_i4.c b/libgfortran/generated/pow_c16_i4.c index d3960520cf9..b0576c5ad44 100644 --- a/libgfortran/generated/pow_c16_i4.c +++ b/libgfortran/generated/pow_c16_i4.c @@ -45,7 +45,8 @@ GFC_COMPLEX_16 pow_c16_i4 (GFC_COMPLEX_16 a, GFC_INTEGER_4 b) { GFC_COMPLEX_16 pow, x; - GFC_INTEGER_4 n, u; + GFC_INTEGER_4 n; + GFC_UINTEGER_4 u; n = b; x = a; @@ -55,10 +56,13 @@ pow_c16_i4 (GFC_COMPLEX_16 a, GFC_INTEGER_4 b) if (n < 0) { - n = -n; + u = -n; x = pow / x; } - u = n; + else + { + u = n; + } for (;;) { if (u & 1) diff --git a/libgfortran/generated/pow_c16_i8.c b/libgfortran/generated/pow_c16_i8.c index 0a0e94d0613..3d991606a40 100644 --- a/libgfortran/generated/pow_c16_i8.c +++ b/libgfortran/generated/pow_c16_i8.c @@ -45,7 +45,8 @@ GFC_COMPLEX_16 pow_c16_i8 (GFC_COMPLEX_16 a, GFC_INTEGER_8 b) { GFC_COMPLEX_16 pow, x; - GFC_INTEGER_8 n, u; + GFC_INTEGER_8 n; + GFC_UINTEGER_8 u; n = b; x = a; @@ -55,10 +56,13 @@ pow_c16_i8 (GFC_COMPLEX_16 a, GFC_INTEGER_8 b) if (n < 0) { - n = -n; + u = -n; x = pow / x; } - u = n; + else + { + u = n; + } for (;;) { if (u & 1) diff --git a/libgfortran/generated/pow_c4_i16.c b/libgfortran/generated/pow_c4_i16.c index 1085ad21caf..84309ff63bd 100644 --- a/libgfortran/generated/pow_c4_i16.c +++ b/libgfortran/generated/pow_c4_i16.c @@ -45,7 +45,8 @@ GFC_COMPLEX_4 pow_c4_i16 (GFC_COMPLEX_4 a, GFC_INTEGER_16 b) { GFC_COMPLEX_4 pow, x; - GFC_INTEGER_16 n, u; + GFC_INTEGER_16 n; + GFC_UINTEGER_16 u; n = b; x = a; @@ -55,10 +56,13 @@ pow_c4_i16 (GFC_COMPLEX_4 a, GFC_INTEGER_16 b) if (n < 0) { - n = -n; + u = -n; x = pow / x; } - u = n; + else + { + u = n; + } for (;;) { if (u & 1) diff --git a/libgfortran/generated/pow_c4_i4.c b/libgfortran/generated/pow_c4_i4.c index ca376710fba..35597d0df16 100644 --- a/libgfortran/generated/pow_c4_i4.c +++ b/libgfortran/generated/pow_c4_i4.c @@ -45,7 +45,8 @@ GFC_COMPLEX_4 pow_c4_i4 (GFC_COMPLEX_4 a, GFC_INTEGER_4 b) { GFC_COMPLEX_4 pow, x; - GFC_INTEGER_4 n, u; + GFC_INTEGER_4 n; + GFC_UINTEGER_4 u; n = b; x = a; @@ -55,10 +56,13 @@ pow_c4_i4 (GFC_COMPLEX_4 a, GFC_INTEGER_4 b) if (n < 0) { - n = -n; + u = -n; x = pow / x; } - u = n; + else + { + u = n; + } for (;;) { if (u & 1) diff --git a/libgfortran/generated/pow_c4_i8.c b/libgfortran/generated/pow_c4_i8.c index f9fc849ca19..bb113df2b47 100644 --- a/libgfortran/generated/pow_c4_i8.c +++ b/libgfortran/generated/pow_c4_i8.c @@ -45,7 +45,8 @@ GFC_COMPLEX_4 pow_c4_i8 (GFC_COMPLEX_4 a, GFC_INTEGER_8 b) { GFC_COMPLEX_4 pow, x; - GFC_INTEGER_8 n, u; + GFC_INTEGER_8 n; + GFC_UINTEGER_8 u; n = b; x = a; @@ -55,10 +56,13 @@ pow_c4_i8 (GFC_COMPLEX_4 a, GFC_INTEGER_8 b) if (n < 0) { - n = -n; + u = -n; x = pow / x; } - u = n; + else + { + u = n; + } for (;;) { if (u & 1) diff --git a/libgfortran/generated/pow_c8_i16.c b/libgfortran/generated/pow_c8_i16.c index 0fc162b5014..ee4b68e955f 100644 --- a/libgfortran/generated/pow_c8_i16.c +++ b/libgfortran/generated/pow_c8_i16.c @@ -45,7 +45,8 @@ GFC_COMPLEX_8 pow_c8_i16 (GFC_COMPLEX_8 a, GFC_INTEGER_16 b) { GFC_COMPLEX_8 pow, x; - GFC_INTEGER_16 n, u; + GFC_INTEGER_16 n; + GFC_UINTEGER_16 u; n = b; x = a; @@ -55,10 +56,13 @@ pow_c8_i16 (GFC_COMPLEX_8 a, GFC_INTEGER_16 b) if (n < 0) { - n = -n; + u = -n; x = pow / x; } - u = n; + else + { + u = n; + } for (;;) { if (u & 1) diff --git a/libgfortran/generated/pow_c8_i4.c b/libgfortran/generated/pow_c8_i4.c index 64b4b3c5b69..30c6007879f 100644 --- a/libgfortran/generated/pow_c8_i4.c +++ b/libgfortran/generated/pow_c8_i4.c @@ -45,7 +45,8 @@ GFC_COMPLEX_8 pow_c8_i4 (GFC_COMPLEX_8 a, GFC_INTEGER_4 b) { GFC_COMPLEX_8 pow, x; - GFC_INTEGER_4 n, u; + GFC_INTEGER_4 n; + GFC_UINTEGER_4 u; n = b; x = a; @@ -55,10 +56,13 @@ pow_c8_i4 (GFC_COMPLEX_8 a, GFC_INTEGER_4 b) if (n < 0) { - n = -n; + u = -n; x = pow / x; } - u = n; + else + { + u = n; + } for (;;) { if (u & 1) diff --git a/libgfortran/generated/pow_c8_i8.c b/libgfortran/generated/pow_c8_i8.c index 39a5d6b71e0..d9b658b4fc4 100644 --- a/libgfortran/generated/pow_c8_i8.c +++ b/libgfortran/generated/pow_c8_i8.c @@ -45,7 +45,8 @@ GFC_COMPLEX_8 pow_c8_i8 (GFC_COMPLEX_8 a, GFC_INTEGER_8 b) { GFC_COMPLEX_8 pow, x; - GFC_INTEGER_8 n, u; + GFC_INTEGER_8 n; + GFC_UINTEGER_8 u; n = b; x = a; @@ -55,10 +56,13 @@ pow_c8_i8 (GFC_COMPLEX_8 a, GFC_INTEGER_8 b) if (n < 0) { - n = -n; + u = -n; x = pow / x; } - u = n; + else + { + u = n; + } for (;;) { if (u & 1) diff --git a/libgfortran/generated/pow_i16_i16.c b/libgfortran/generated/pow_i16_i16.c index eda2fb6dc7c..b665f5ea2b9 100644 --- a/libgfortran/generated/pow_i16_i16.c +++ b/libgfortran/generated/pow_i16_i16.c @@ -45,7 +45,8 @@ GFC_INTEGER_16 pow_i16_i16 (GFC_INTEGER_16 a, GFC_INTEGER_16 b) { GFC_INTEGER_16 pow, x; - GFC_INTEGER_16 n, u; + GFC_INTEGER_16 n; + GFC_UINTEGER_16 u; n = b; x = a; @@ -60,7 +61,10 @@ pow_i16_i16 (GFC_INTEGER_16 a, GFC_INTEGER_16 b) return (n & 1) ? -1 : 1; return (x == 0) ? 1 / x : 0; } - u = n; + else + { + u = n; + } for (;;) { if (u & 1) diff --git a/libgfortran/generated/pow_i16_i4.c b/libgfortran/generated/pow_i16_i4.c index 6e4d65c35c4..45994a3598e 100644 --- a/libgfortran/generated/pow_i16_i4.c +++ b/libgfortran/generated/pow_i16_i4.c @@ -45,7 +45,8 @@ GFC_INTEGER_16 pow_i16_i4 (GFC_INTEGER_16 a, GFC_INTEGER_4 b) { GFC_INTEGER_16 pow, x; - GFC_INTEGER_4 n, u; + GFC_INTEGER_4 n; + GFC_UINTEGER_4 u; n = b; x = a; @@ -60,7 +61,10 @@ pow_i16_i4 (GFC_INTEGER_16 a, GFC_INTEGER_4 b) return (n & 1) ? -1 : 1; return (x == 0) ? 1 / x : 0; } - u = n; + else + { + u = n; + } for (;;) { if (u & 1) diff --git a/libgfortran/generated/pow_i16_i8.c b/libgfortran/generated/pow_i16_i8.c index d1849511a29..80075051553 100644 --- a/libgfortran/generated/pow_i16_i8.c +++ b/libgfortran/generated/pow_i16_i8.c @@ -45,7 +45,8 @@ GFC_INTEGER_16 pow_i16_i8 (GFC_INTEGER_16 a, GFC_INTEGER_8 b) { GFC_INTEGER_16 pow, x; - GFC_INTEGER_8 n, u; + GFC_INTEGER_8 n; + GFC_UINTEGER_8 u; n = b; x = a; @@ -60,7 +61,10 @@ pow_i16_i8 (GFC_INTEGER_16 a, GFC_INTEGER_8 b) return (n & 1) ? -1 : 1; return (x == 0) ? 1 / x : 0; } - u = n; + else + { + u = n; + } for (;;) { if (u & 1) diff --git a/libgfortran/generated/pow_i4_i16.c b/libgfortran/generated/pow_i4_i16.c index f515f80359e..abab476830c 100644 --- a/libgfortran/generated/pow_i4_i16.c +++ b/libgfortran/generated/pow_i4_i16.c @@ -45,7 +45,8 @@ GFC_INTEGER_4 pow_i4_i16 (GFC_INTEGER_4 a, GFC_INTEGER_16 b) { GFC_INTEGER_4 pow, x; - GFC_INTEGER_16 n, u; + GFC_INTEGER_16 n; + GFC_UINTEGER_16 u; n = b; x = a; @@ -60,7 +61,10 @@ pow_i4_i16 (GFC_INTEGER_4 a, GFC_INTEGER_16 b) return (n & 1) ? -1 : 1; return (x == 0) ? 1 / x : 0; } - u = n; + else + { + u = n; + } for (;;) { if (u & 1) diff --git a/libgfortran/generated/pow_i4_i4.c b/libgfortran/generated/pow_i4_i4.c index 184fe6d986e..e28cf90b116 100644 --- a/libgfortran/generated/pow_i4_i4.c +++ b/libgfortran/generated/pow_i4_i4.c @@ -45,7 +45,8 @@ GFC_INTEGER_4 pow_i4_i4 (GFC_INTEGER_4 a, GFC_INTEGER_4 b) { GFC_INTEGER_4 pow, x; - GFC_INTEGER_4 n, u; + GFC_INTEGER_4 n; + GFC_UINTEGER_4 u; n = b; x = a; @@ -60,7 +61,10 @@ pow_i4_i4 (GFC_INTEGER_4 a, GFC_INTEGER_4 b) return (n & 1) ? -1 : 1; return (x == 0) ? 1 / x : 0; } - u = n; + else + { + u = n; + } for (;;) { if (u & 1) diff --git a/libgfortran/generated/pow_i4_i8.c b/libgfortran/generated/pow_i4_i8.c index ae24ceb54c2..51d2e14a808 100644 --- a/libgfortran/generated/pow_i4_i8.c +++ b/libgfortran/generated/pow_i4_i8.c @@ -45,7 +45,8 @@ GFC_INTEGER_4 pow_i4_i8 (GFC_INTEGER_4 a, GFC_INTEGER_8 b) { GFC_INTEGER_4 pow, x; - GFC_INTEGER_8 n, u; + GFC_INTEGER_8 n; + GFC_UINTEGER_8 u; n = b; x = a; @@ -60,7 +61,10 @@ pow_i4_i8 (GFC_INTEGER_4 a, GFC_INTEGER_8 b) return (n & 1) ? -1 : 1; return (x == 0) ? 1 / x : 0; } - u = n; + else + { + u = n; + } for (;;) { if (u & 1) diff --git a/libgfortran/generated/pow_i8_i16.c b/libgfortran/generated/pow_i8_i16.c index 456c28a95bd..88713da698e 100644 --- a/libgfortran/generated/pow_i8_i16.c +++ b/libgfortran/generated/pow_i8_i16.c @@ -45,7 +45,8 @@ GFC_INTEGER_8 pow_i8_i16 (GFC_INTEGER_8 a, GFC_INTEGER_16 b) { GFC_INTEGER_8 pow, x; - GFC_INTEGER_16 n, u; + GFC_INTEGER_16 n; + GFC_UINTEGER_16 u; n = b; x = a; @@ -60,7 +61,10 @@ pow_i8_i16 (GFC_INTEGER_8 a, GFC_INTEGER_16 b) return (n & 1) ? -1 : 1; return (x == 0) ? 1 / x : 0; } - u = n; + else + { + u = n; + } for (;;) { if (u & 1) diff --git a/libgfortran/generated/pow_i8_i4.c b/libgfortran/generated/pow_i8_i4.c index 8f85a80c81c..6746af33d5b 100644 --- a/libgfortran/generated/pow_i8_i4.c +++ b/libgfortran/generated/pow_i8_i4.c @@ -45,7 +45,8 @@ GFC_INTEGER_8 pow_i8_i4 (GFC_INTEGER_8 a, GFC_INTEGER_4 b) { GFC_INTEGER_8 pow, x; - GFC_INTEGER_4 n, u; + GFC_INTEGER_4 n; + GFC_UINTEGER_4 u; n = b; x = a; @@ -60,7 +61,10 @@ pow_i8_i4 (GFC_INTEGER_8 a, GFC_INTEGER_4 b) return (n & 1) ? -1 : 1; return (x == 0) ? 1 / x : 0; } - u = n; + else + { + u = n; + } for (;;) { if (u & 1) diff --git a/libgfortran/generated/pow_i8_i8.c b/libgfortran/generated/pow_i8_i8.c index 8c8f52e5412..3050974036c 100644 --- a/libgfortran/generated/pow_i8_i8.c +++ b/libgfortran/generated/pow_i8_i8.c @@ -45,7 +45,8 @@ GFC_INTEGER_8 pow_i8_i8 (GFC_INTEGER_8 a, GFC_INTEGER_8 b) { GFC_INTEGER_8 pow, x; - GFC_INTEGER_8 n, u; + GFC_INTEGER_8 n; + GFC_UINTEGER_8 u; n = b; x = a; @@ -60,7 +61,10 @@ pow_i8_i8 (GFC_INTEGER_8 a, GFC_INTEGER_8 b) return (n & 1) ? -1 : 1; return (x == 0) ? 1 / x : 0; } - u = n; + else + { + u = n; + } for (;;) { if (u & 1) diff --git a/libgfortran/generated/pow_r10_i16.c b/libgfortran/generated/pow_r10_i16.c index ad736641adc..2377e67ca51 100644 --- a/libgfortran/generated/pow_r10_i16.c +++ b/libgfortran/generated/pow_r10_i16.c @@ -45,7 +45,8 @@ GFC_REAL_10 pow_r10_i16 (GFC_REAL_10 a, GFC_INTEGER_16 b) { GFC_REAL_10 pow, x; - GFC_INTEGER_16 n, u; + GFC_INTEGER_16 n; + GFC_UINTEGER_16 u; n = b; x = a; @@ -55,10 +56,13 @@ pow_r10_i16 (GFC_REAL_10 a, GFC_INTEGER_16 b) if (n < 0) { - n = -n; + u = -n; x = pow / x; } - u = n; + else + { + u = n; + } for (;;) { if (u & 1) diff --git a/libgfortran/generated/pow_r10_i4.c b/libgfortran/generated/pow_r10_i4.c index 3f2373243b4..d21869b5d2c 100644 --- a/libgfortran/generated/pow_r10_i4.c +++ b/libgfortran/generated/pow_r10_i4.c @@ -45,7 +45,8 @@ GFC_REAL_10 pow_r10_i4 (GFC_REAL_10 a, GFC_INTEGER_4 b) { GFC_REAL_10 pow, x; - GFC_INTEGER_4 n, u; + GFC_INTEGER_4 n; + GFC_UINTEGER_4 u; n = b; x = a; @@ -55,10 +56,13 @@ pow_r10_i4 (GFC_REAL_10 a, GFC_INTEGER_4 b) if (n < 0) { - n = -n; + u = -n; x = pow / x; } - u = n; + else + { + u = n; + } for (;;) { if (u & 1) diff --git a/libgfortran/generated/pow_r10_i8.c b/libgfortran/generated/pow_r10_i8.c index 2e99c600bea..5a5ecffdb44 100644 --- a/libgfortran/generated/pow_r10_i8.c +++ b/libgfortran/generated/pow_r10_i8.c @@ -45,7 +45,8 @@ GFC_REAL_10 pow_r10_i8 (GFC_REAL_10 a, GFC_INTEGER_8 b) { GFC_REAL_10 pow, x; - GFC_INTEGER_8 n, u; + GFC_INTEGER_8 n; + GFC_UINTEGER_8 u; n = b; x = a; @@ -55,10 +56,13 @@ pow_r10_i8 (GFC_REAL_10 a, GFC_INTEGER_8 b) if (n < 0) { - n = -n; + u = -n; x = pow / x; } - u = n; + else + { + u = n; + } for (;;) { if (u & 1) diff --git a/libgfortran/generated/pow_r16_i16.c b/libgfortran/generated/pow_r16_i16.c index 63d6fa886f2..24313c2df2a 100644 --- a/libgfortran/generated/pow_r16_i16.c +++ b/libgfortran/generated/pow_r16_i16.c @@ -45,7 +45,8 @@ GFC_REAL_16 pow_r16_i16 (GFC_REAL_16 a, GFC_INTEGER_16 b) { GFC_REAL_16 pow, x; - GFC_INTEGER_16 n, u; + GFC_INTEGER_16 n; + GFC_UINTEGER_16 u; n = b; x = a; @@ -55,10 +56,13 @@ pow_r16_i16 (GFC_REAL_16 a, GFC_INTEGER_16 b) if (n < 0) { - n = -n; + u = -n; x = pow / x; } - u = n; + else + { + u = n; + } for (;;) { if (u & 1) diff --git a/libgfortran/generated/pow_r16_i4.c b/libgfortran/generated/pow_r16_i4.c index 949f2371749..3901577ecc7 100644 --- a/libgfortran/generated/pow_r16_i4.c +++ b/libgfortran/generated/pow_r16_i4.c @@ -45,7 +45,8 @@ GFC_REAL_16 pow_r16_i4 (GFC_REAL_16 a, GFC_INTEGER_4 b) { GFC_REAL_16 pow, x; - GFC_INTEGER_4 n, u; + GFC_INTEGER_4 n; + GFC_UINTEGER_4 u; n = b; x = a; @@ -55,10 +56,13 @@ pow_r16_i4 (GFC_REAL_16 a, GFC_INTEGER_4 b) if (n < 0) { - n = -n; + u = -n; x = pow / x; } - u = n; + else + { + u = n; + } for (;;) { if (u & 1) diff --git a/libgfortran/generated/pow_r16_i8.c b/libgfortran/generated/pow_r16_i8.c index 37649d82cb1..e7233729b48 100644 --- a/libgfortran/generated/pow_r16_i8.c +++ b/libgfortran/generated/pow_r16_i8.c @@ -45,7 +45,8 @@ GFC_REAL_16 pow_r16_i8 (GFC_REAL_16 a, GFC_INTEGER_8 b) { GFC_REAL_16 pow, x; - GFC_INTEGER_8 n, u; + GFC_INTEGER_8 n; + GFC_UINTEGER_8 u; n = b; x = a; @@ -55,10 +56,13 @@ pow_r16_i8 (GFC_REAL_16 a, GFC_INTEGER_8 b) if (n < 0) { - n = -n; + u = -n; x = pow / x; } - u = n; + else + { + u = n; + } for (;;) { if (u & 1) diff --git a/libgfortran/generated/pow_r4_i16.c b/libgfortran/generated/pow_r4_i16.c index 635e627e9d6..e73794952d7 100644 --- a/libgfortran/generated/pow_r4_i16.c +++ b/libgfortran/generated/pow_r4_i16.c @@ -45,7 +45,8 @@ GFC_REAL_4 pow_r4_i16 (GFC_REAL_4 a, GFC_INTEGER_16 b) { GFC_REAL_4 pow, x; - GFC_INTEGER_16 n, u; + GFC_INTEGER_16 n; + GFC_UINTEGER_16 u; n = b; x = a; @@ -55,10 +56,13 @@ pow_r4_i16 (GFC_REAL_4 a, GFC_INTEGER_16 b) if (n < 0) { - n = -n; + u = -n; x = pow / x; } - u = n; + else + { + u = n; + } for (;;) { if (u & 1) diff --git a/libgfortran/generated/pow_r4_i4.c b/libgfortran/generated/pow_r4_i4.c index ff0045f913b..5baa4b17f68 100644 --- a/libgfortran/generated/pow_r4_i4.c +++ b/libgfortran/generated/pow_r4_i4.c @@ -45,7 +45,8 @@ GFC_REAL_4 pow_r4_i4 (GFC_REAL_4 a, GFC_INTEGER_4 b) { GFC_REAL_4 pow, x; - GFC_INTEGER_4 n, u; + GFC_INTEGER_4 n; + GFC_UINTEGER_4 u; n = b; x = a; @@ -55,10 +56,13 @@ pow_r4_i4 (GFC_REAL_4 a, GFC_INTEGER_4 b) if (n < 0) { - n = -n; + u = -n; x = pow / x; } - u = n; + else + { + u = n; + } for (;;) { if (u & 1) diff --git a/libgfortran/generated/pow_r4_i8.c b/libgfortran/generated/pow_r4_i8.c index 8c6b2ba285f..0aae60a7d45 100644 --- a/libgfortran/generated/pow_r4_i8.c +++ b/libgfortran/generated/pow_r4_i8.c @@ -45,7 +45,8 @@ GFC_REAL_4 pow_r4_i8 (GFC_REAL_4 a, GFC_INTEGER_8 b) { GFC_REAL_4 pow, x; - GFC_INTEGER_8 n, u; + GFC_INTEGER_8 n; + GFC_UINTEGER_8 u; n = b; x = a; @@ -55,10 +56,13 @@ pow_r4_i8 (GFC_REAL_4 a, GFC_INTEGER_8 b) if (n < 0) { - n = -n; + u = -n; x = pow / x; } - u = n; + else + { + u = n; + } for (;;) { if (u & 1) diff --git a/libgfortran/generated/pow_r8_i16.c b/libgfortran/generated/pow_r8_i16.c index 9fdcf7592e4..e527f3a7a1e 100644 --- a/libgfortran/generated/pow_r8_i16.c +++ b/libgfortran/generated/pow_r8_i16.c @@ -45,7 +45,8 @@ GFC_REAL_8 pow_r8_i16 (GFC_REAL_8 a, GFC_INTEGER_16 b) { GFC_REAL_8 pow, x; - GFC_INTEGER_16 n, u; + GFC_INTEGER_16 n; + GFC_UINTEGER_16 u; n = b; x = a; @@ -55,10 +56,13 @@ pow_r8_i16 (GFC_REAL_8 a, GFC_INTEGER_16 b) if (n < 0) { - n = -n; + u = -n; x = pow / x; } - u = n; + else + { + u = n; + } for (;;) { if (u & 1) diff --git a/libgfortran/generated/pow_r8_i4.c b/libgfortran/generated/pow_r8_i4.c index a6afcbe6eb4..8da3b81fdff 100644 --- a/libgfortran/generated/pow_r8_i4.c +++ b/libgfortran/generated/pow_r8_i4.c @@ -45,7 +45,8 @@ GFC_REAL_8 pow_r8_i4 (GFC_REAL_8 a, GFC_INTEGER_4 b) { GFC_REAL_8 pow, x; - GFC_INTEGER_4 n, u; + GFC_INTEGER_4 n; + GFC_UINTEGER_4 u; n = b; x = a; @@ -55,10 +56,13 @@ pow_r8_i4 (GFC_REAL_8 a, GFC_INTEGER_4 b) if (n < 0) { - n = -n; + u = -n; x = pow / x; } - u = n; + else + { + u = n; + } for (;;) { if (u & 1) diff --git a/libgfortran/generated/pow_r8_i8.c b/libgfortran/generated/pow_r8_i8.c index 3b650f2f073..b858fab3a29 100644 --- a/libgfortran/generated/pow_r8_i8.c +++ b/libgfortran/generated/pow_r8_i8.c @@ -45,7 +45,8 @@ GFC_REAL_8 pow_r8_i8 (GFC_REAL_8 a, GFC_INTEGER_8 b) { GFC_REAL_8 pow, x; - GFC_INTEGER_8 n, u; + GFC_INTEGER_8 n; + GFC_UINTEGER_8 u; n = b; x = a; @@ -55,10 +56,13 @@ pow_r8_i8 (GFC_REAL_8 a, GFC_INTEGER_8 b) if (n < 0) { - n = -n; + u = -n; x = pow / x; } - u = n; + else + { + u = n; + } for (;;) { if (u & 1) diff --git a/libgfortran/m4/pow.m4 b/libgfortran/m4/pow.m4 index ae490040c65..54e2fda03c2 100644 --- a/libgfortran/m4/pow.m4 +++ b/libgfortran/m4/pow.m4 @@ -46,7 +46,8 @@ rtype_name `pow_'rtype_code`_'atype_code (rtype_name a, atype_name b) { rtype_name pow, x; - atype_name n, u; + atype_name n; + `GFC_UINTEGER_'atype_kind` u;' n = b; x = a; @@ -62,11 +63,14 @@ ifelse(rtype_letter,i,`dnl return (n & 1) ? -1 : 1; return (x == 0) ? 1 / x : 0; ',` - n = -n; + u = -n; x = pow / x; ')dnl } - u = n; + else + { + u = n; + } for (;;) { if (u & 1) |