This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/48543] Collapse identical strings
- From: "tkoenig at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 07 Jun 2012 14:58:38 +0000
- Subject: [Bug fortran/48543] Collapse identical strings
- Auto-submitted: auto-generated
- References: <bug-48543-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48543
--- Comment #2 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2012-06-07 14:58:38 UTC ---
I'll do a bit of work on that, because it can also be useful
for reducing memcpy/memset pairs.
Consider
character(len=3) :: a
character(len=4) :: b
a = 'a'
b = 'a'
This could be changed into (in a first pass)
a = 'a '
b = 'a '
for a simple assignment, but this would mean duplicate strings.
Better to change this into
a = 'a '
b = 'a '