This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fold early


On Friday 02 January 2004 8:08 am, HUANG Chun wrote:
> Steven wrote:
> >2003-12-20  Steven Bosscher  <stevenb@suse.de>
> >
> >	* trans-expr.c (gfc_conv_expr_op): Fold the result expression.
> >	* trans.c (gfc_add_modify_expr, gfc_add_expr_to_block): Likewise.
>
> In function gfc_add_expr_to_block, the result expression can not be folded.
> e.g:
>
> i=10
> if(i.le.0) then
> else
>   print *,'hello'
> endif
> end
>
> If the result was folded in gfc_add_expr_to_block, the if_block can not be
> done corretly.

Problem is that we're then back to the original problem of not folding 
statements properly. The proper fix is complete the if statements before 
adding/folding them. This means we have to make gfc_trans_if recursive in 
some form, but that's no big deal. See other post for patch.

Paul


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]