public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "juergen.reuter at desy dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/65894] [6 Regression] severe regression in gfortran 6.0.0
Date: Thu, 07 May 2015 10:14:00 -0000	[thread overview]
Message-ID: <bug-65894-4-8vy2a434GE@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-65894-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65894

--- Comment #19 from Jürgen Reuter <juergen.reuter at desy dot de> ---
Of course, we are fine (or even happy) if you take our code examples for your
regression tests.
>From gcc-bugs-return-485727-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu May 07 10:30:11 2015
Return-Path: <gcc-bugs-return-485727-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 88827 invoked by alias); 7 May 2015 10:30:11 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 88752 invoked by uid 48); 7 May 2015 10:30:06 -0000
From: "gcc at mattwhitlock dot name" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/192] String literals don't obey -fdata-sections
Date: Thu, 07 May 2015 10:30:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: middle-end
X-Bugzilla-Version: 2.95.2
X-Bugzilla-Keywords: missed-optimization
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: gcc at mattwhitlock dot name
X-Bugzilla-Status: NEW
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-192-4-2pWHPPfO8t@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-192-4@http.gcc.gnu.org/bugzilla/>
References: <bug-192-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-05/txt/msg00567.txt.bz2
Content-length: 1885

https://gcc.gnu.org/bugzilla/show_bug.cgi?id\x192

--- Comment #15 from Matt Whitlock <gcc at mattwhitlock dot name> ---
(In reply to Jakub Jelinek from comment #14)
> This doesn't really look like a good idea to me.  Instead, perhaps ld's
> --gc-sections or new special option should just remove unused string
> literals from mergeable sections.

I believe (I've read, but I haven't verified) that Gold already does this.

> With your patch, I bet you lose e.g. all tail merging.

Tail merging still works fine.

> Consider:
> const char *used1 () { return "foo bar baz blah blah"; }
> in one TU and
> const char *used2 () { return "bar baz blah blah"; }
> in another.

Okay, I'll use your example.

$ echo 'const char *used1 () { return "foo bar baz blah blah"; }' > tu1.c
$ echo 'const char *used2 () { return "bar baz blah blah"; }' > tu2.c
$ cat > main.c <<EOF
extern const char * used1(), * used2();
int main() { puts(used1()); puts(used2()); return 0; }
EOF

$ gcc -c -fdata-sections -fmerge-constants -o tu1.o tu1.c
$ gcc -c -fdata-sections -fmerge-constants -o tu2.o tu2.c
$ gcc -c -fdata-sections -fmerge-constants -o main.o main.c

$ objdump -s tu1.o tu2.o | fgrep -A2 .rodata
Contents of section .rodata.str1.1.b4d3fd7d:
 0000 666f6f20 62617220 62617a20 626c6168  foo bar baz blah
 0010 20626c61 6800                         blah.
--
Contents of section .rodata.str1.1.a07ea0c2:
 0000 62617220 62617a20 626c6168 20626c61  bar baz blah bla
 0010 6800                                 h.

$ gcc -Wl,--gc-sections -o proof main.o tu1.o tu2.o

$ ./proof
foo bar baz blah blah
bar baz blah blah

$ objdump -s proof | fgrep -A2 .rodata
Contents of section .rodata:
 40061d 666f6f20 62617220 62617a20 626c6168  foo bar baz blah
 40062d 20626c61 6800                         blah.

As you can see, tail merging across translation units works fine.


  parent reply	other threads:[~2015-05-07 10:14 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-26 14:35 [Bug fortran/65894] New: " juergen.reuter at desy dot de
2015-04-26 15:02 ` [Bug fortran/65894] " juergen.reuter at desy dot de
2015-04-27  9:20 ` [Bug fortran/65894] [6 Regression] " rguenth at gcc dot gnu.org
2015-04-27  9:27 ` vehre at gcc dot gnu.org
2015-04-27  9:40 ` juergen.reuter at desy dot de
2015-04-27  9:41 ` juergen.reuter at desy dot de
2015-04-27 16:56 ` vehre at gcc dot gnu.org
2015-04-28  6:33 ` dominiq at lps dot ens.fr
2015-04-28 11:59 ` juergen.reuter at desy dot de
2015-04-28 16:10 ` juergen.reuter at desy dot de
2015-05-05 17:12 ` vehre at gcc dot gnu.org
2015-05-05 17:35 ` juergen.reuter at desy dot de
2015-05-05 18:06 ` vehre at gcc dot gnu.org
2015-05-06  6:54 ` dominiq at lps dot ens.fr
2015-05-07  9:54 ` vehre at gcc dot gnu.org
2015-05-07  9:57 ` juergen.reuter at desy dot de
2015-05-07 10:09 ` vehre at gcc dot gnu.org
2015-05-07 10:14 ` juergen.reuter at desy dot de [this message]
2015-05-07 12:10 ` juergen.reuter at desy dot de
2015-05-07 12:20 ` dominiq at lps dot ens.fr
2015-05-07 12:22 ` juergen.reuter at desy dot de
2015-05-07 12:38 ` juergen.reuter at desy dot de
2015-05-07 19:27 ` dominiq at lps dot ens.fr
2015-05-07 20:46 ` dominiq at lps dot ens.fr
2015-05-08  5:36 ` juergen.reuter at desy dot de
2015-05-08 12:47 ` dominiq at lps dot ens.fr
2015-05-08 18:53 ` dominiq at lps dot ens.fr
2015-05-09 13:36 ` mikael at gcc dot gnu.org
2015-05-10 13:40 ` mikael at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-65894-4-8vy2a434GE@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).