[gfortran] Patch for optimized Arithmetic IF

Steve Kargl sgk@troutmask.apl.washington.edu
Sun Aug 14 12:48:00 GMT 2005


On Tue, Aug 02, 2005 at 10:23:28PM +0800, Canqun Yang wrote:
> 
> In case of equal labels, ARITHMETIC IF can be translated to a simple version.
> 
> E.g.
>    IF (a) 10, 20, 20
>    
>    can be translated to
>    
>    if (a < 0) goto label_10;
>    else goto label_20; 
>   
>    instead of the current one generated by GCC Fortran 95 frontend.
> 
>     if (a <= 0)
>       {
>         if (a < 0) goto label_10;
>         else goto label_20;
>       }
>     else
>       goto label_20;
> 
> This patch can lead the previous optimized code, OK to apply?
> 

This is ok for mainline and 4.0.

-- 
Steve



More information about the Fortran mailing list