[gfortran] Patch for optimized Arithmetic IF

Canqun Yang canqun@nudt.edu.cn
Tue Aug 2 14:14:00 GMT 2005


Hi, all,

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?

Canqun Yang
Creative Compiler Research Group.
National University of Defense Technology, China.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: arith_if.diff
Type: text/x-patch
Size: 3605 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20050802/a34cc8ea/attachment.bin>


More information about the Fortran mailing list