On 08/11/2010 10:59 AM, Ralf W. Grosse-Kunstleve wrote: > My original posting shows that gfortran and g++ don't do as good > a job as ifort in generating efficient machine code. Note that the > loss going from gfortran to g++ isn't as bad as going from ifort to > gfortran. This gives me hope that the gcc developers could work over > time towards bringing the performance of the g++-generated code > closer to the original ifort performance.
While of course there's room for g++ to improve, I think it's more likely that gfortran can improve to meet ifort. The biggest issue, from the compiler writer's perspective, is that the Fortran language provides more information to the optimizers than the C++ language can. A Really Good compiler will probably always be able to do better with Fortran than C++. > I think speed will be the major argument against using the C++ code > generated by the automatic converter. How about using an automatic converter to arrange for C++ code to call into the generated Fortran code instead? Create nice classes and wrappers and such, but in the end arrange for the Fortran code to be called to do the real work. r~