public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/48543] New: Collapse identical strings
@ 2011-04-10 18:31 tkoenig at gcc dot gnu.org
  2011-04-11 10:05 ` [Bug fortran/48543] " jb at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2011-04-10 18:31 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: Collapse identical strings
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: tkoenig@gcc.gnu.org


The two programs yield identical results. The second program
results in a shorter object file because the 

ig25@linux-fd1f:~/Krempel/String> cat foo.f90
program main
  character(len=17) :: a
  character(len=34) :: b
  a = 'Supercalifragilis'
  b = 'Supercalifragilisticexpialidocious'
  print *,a," ",b
end program main
ig25@linux-fd1f:~/Krempel/String> cat bar.f90
program main
  character(len=17) :: a
  character(len=34) :: b
  a = 'Supercalifragilisticexpialidocious'
  b = 'Supercalifragilisticexpialidocious'
  print *,a," ",b
end program main
ig25@linux-fd1f:~/Krempel/String> gfortran -c -Os foo.f90
ig25@linux-fd1f:~/Krempel/String> gfortran -c -Os bar.f90
ig25@linux-fd1f:~/Krempel/String> ls -l foo.f90 bar.f90
-rw-r--r-- 1 ig25 users 184 10. Apr 19:02 bar.f90
-rw-r--r-- 1 ig25 users 167 10. Apr 19:01 foo.f90
g25@linux-fd1f:~/Krempel/String> strings foo.o | grep Super
SupercalifragilisSupercalifragilisticexpialidocious
ig25@linux-fd1f:~/Krempel/String> strings bar.o | grep Super
Supercalifragilisticexpialidocious

This is an optimization that could be done for -Os, at least.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-06-07 14:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-10 18:31 [Bug fortran/48543] New: Collapse identical strings tkoenig at gcc dot gnu.org
2011-04-11 10:05 ` [Bug fortran/48543] " jb at gcc dot gnu.org
2011-11-08  7:44 ` fxcoudert at gcc dot gnu.org
2012-06-07 14:59 ` tkoenig at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).