[gfortran,patch] Fix constant exponentiation with integer exponent

François-Xavier Coudert fxcoudert@gmail.com
Wed Mar 21 09:24:00 GMT 2007

> The patch comes with somewhat long testcases. Regtested on i686-
> linux, OK for mainline? Do you think it's OK for 4.2? (I'm not sure,
> it's rather invasive... and the cases where the compiler actually got
> it wrong were... rather rarely used)

After some more thinking (and some testing of the trans-const.c patch
for very large integers with -fno-range-check), here's an updated
patch. The changes are small, they only make sure that we don't reject
i**j when all of the following conditions are fulfilled:
  (a) i and j are integers
  (b) i is larger than huge(0_4)
  (c) i**j overflows (that is, j>0 and i>1)
  (d) -fno-range-check is specified.
The integer_exponentiation_5.F90 testcase, which uses
-fno-range-check, was updated to test this code path.

Regtested once more on i686-linux (it needs the patch for PR31262,
which can be found here:
http://gcc.gnu.org/ml/gcc-patches/2007-03/msg01332.html ; Jerry is
currently reviewing it, so it should be commited soon). OK for
mainline? Still same question as quoted above for 4.2.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr30834_4.ChangeLog
Type: application/octet-stream
Size: 456 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070321/abea4720/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr30834_4.diff
Type: text/x-patch
Size: 15422 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070321/abea4720/attachment.bin>

More information about the Gcc-patches mailing list