Take:
character(2) :: c
character(1) :: a
character(1) :: b
c = a//b
end

----
We get:
  _gfortran_concat_string (2, str.1, 1, &a, 1, &b);
  _gfortran_copy_string (2, &c, 2, str.1);


We should be able to get:
  _gfortran_concat_string (2, &c, 1, &a, 1, &b);

Instead and get rid of the tempory variable of str.1.


-- 
           Summary: concat of strings create an extra temporary variable
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25714


Reply via email to