[FORTRAN PATCH]: Improved integer SIGN intrinsic (& bug-fix)

Roger Sayle roger@eyesopen.com
Wed Jan 24 18:56:00 GMT 2007


Hi FX,

On Sat, January 20, 2007 5:34 am, FX Coudert wrote:
>> 2007-01-19  Roger Sayle  <roger@eyesopen.com>
>>
>>         * trans-intrinsic.c (gfc_conv_intrinsic_sign): New branchless
>>         implementation for the SIGN intrinsic with integral operands.
>>         (gfc_conv_intrinsic_minmax): Fix whitespace.
>
> OK for 4.3 and 4.2, as is. Please also include in your commit the
> attached testcase, that includes Brooks' testcase and Steve's
> comment, as well as tests for the largest integer value of each
> integer kind.
>
> For 4.1, it would be better to only add a call to gfc_evaluate_now.
> If you don't intend to do it, could you file a PR so that it doesn't
> get lost?

Many thanks for the review.  I've now committed the original patch and
the two test cases to mainline and the 4.2 branch, after bootstraps and
regression tests and confirming the new tests pass with the patch but fail
on an unpatched tree.

The following variant is the suggested minimal fix for the 4.1 release
branch, including the two new testcases already on mainline.  This has
again been tested using the above protocol on x86_64-unknown-linux-gnu,
with no new regressions, where it resolves the testcase failures.

Ok for the 4.1 branch?


2007-01-24  Roger Sayle  <roger@eyesopen.com>

        * trans-intrinsic.c (gfc_conv_intrinsic_sign): Call
        gfc_evaluate_now to prevent re-evaluation of first operand.

2007-01-24  Roger Sayle  <roger@eyesopen.com>
            Brooks Moses  <brooks.moses@codesourcery.com>
            Francois-Xavier Coudert  <coudert@clipper.ens.fr>

        * gfortran.dg/intrinsic_sign_1.f90: New test case.
        * gfortran.dg/intrinsic_sign_2.f90: Likewise.

Roger
--
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patchs.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070124/88066431/attachment.txt>


More information about the Gcc-patches mailing list