This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [fortran, patch] Fix pow op.
- From: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- To: Feng Wang <wf_cs at yahoo dot com>
- Cc: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Fri, 12 Aug 2005 23:23:39 -0700
- Subject: Re: [fortran, patch] Fix pow op.
- References: <20050804040510.30518.qmail@web15606.mail.cnb.yahoo.com>
On Thu, Aug 04, 2005 at 12:05:10PM +0800, Feng Wang wrote:
> This patch fixed pow operation. We should evaluate the first operator.
>
>
> Index: trans-expr.c
> ===================================================================
> RCS file: /cvs/gcc/gcc/gcc/fortran/trans-expr.c,v
> retrieving revision 1.55
> diff -c -3 -p -r1.55 trans-expr.c
> *** trans-expr.c 4 Aug 2005 03:06:12 -0000 1.55
> --- trans-expr.c 4 Aug 2005 03:37:41 -0000
> *************** gfc_conv_power_op (gfc_se * se, gfc_expr
> *** 654,659 ****
> --- 654,660 ----
>
> gfc_init_se (&lse, se);
> gfc_conv_expr_val (&lse, expr->value.op.op1);
> + lse.expr = gfc_evaluate_now (lse.expr, &lse.pre);
> gfc_add_block_to_block (&se->pre, &lse.pre);
>
> gfc_init_se (&rse, se);
This is ok for both mainline and 4.0. Please, include a
ChangeLog entry with your patches.
--
Steve