[Patch, fortran] Improve common function elimination

Thomas Koenig tkoenig@netcologne.de
Sun Dec 18 10:15:00 GMT 2011


Hello world,

here is the reworked patch for improving function elimination.
It turned out to be much simpler than the original one.

Because real constants (and complex) constants are compared
for equality only, it should be pretty safe.

OK for trunk?

	Thomas

2011-12-17  Thomas Koenig  <tkoenig@gcc.gnu.org>

         * dependency.c (gfc_dep_compare_functions):  Document
         new behavior for REALs and complex.  Add comment to cases
         where only INTEGERs are handled.  Compare REAL and COMPLEX
         constants, returning 0 and -2 only.  Add assert to make
         sure that only integer constants are compared.

2011-12-17  Thomas Koenig  <tkoenig@gcc.gnu.org>

         * gfortran.dg/function_optimize_9.f90:  New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p2.diff
Type: text/x-patch
Size: 3465 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20111218/183a6956/attachment.bin>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: function_optimize_9.f90
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20111218/183a6956/attachment.f90>


More information about the Fortran mailing list