This is just a collector of optimizations that the front end could do before generating tree codes.
Confirmed.
Among the unneeded temporaries, the array constructor (e.g. PR33341) is the most annoying, i.e. the most often reported, one.
I would like to ping this PR... progress here seems valuable, and typical stage 1 stuff.
more useless temps...the last two added eat quite a few percent of performance in CP2K. This really is an issue where frontend people need to step in to improve the performance of gfortran.
Subject: Bug 36854 Author: tkoenig Date: Mon Aug 2 16:53:51 2010 New Revision: 162824 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=162824 Log: 2010-08-02 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36854 * dependency.h: Add prototype for gfc_are_identical_variables. * frontend-passes.c: Include depencency.h. (optimimize_equality): Use gfc_are_identical_variables. * dependency.c (identical_array_ref): New function. (gfc_are_identical_variables): New function. (gfc_deb_compare_expr): Use gfc_are_identical_variables. * dependency.c (gfc_check_section_vs_section). Rename gfc_ prefix from statc function. (check_section_vs_section): Change arguments to gfc_array_ref, adjust function body accordingly. 2010-08-02 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/36854 * gfortran.dg/character_comparison_2.f90: New test. * gfortran.dg/character_comparison_3.f90: New test. * gfortran.dg/dependency_28.f90: New test. Added: trunk/gcc/testsuite/gfortran.dg/character_comparison_2.f90 trunk/gcc/testsuite/gfortran.dg/character_comparison_3.f90 trunk/gcc/testsuite/gfortran.dg/dependency_28.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/dependency.c trunk/gcc/fortran/dependency.h trunk/gcc/fortran/frontend-passes.c trunk/gcc/testsuite/ChangeLog