From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25940 invoked by alias); 1 Oct 2012 17:55:45 -0000 Received: (qmail 25851 invoked by uid 48); 1 Oct 2012 17:55:31 -0000 From: "pbrook at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/54303] -fdata-sections -ffunction-sections and -fmerge-constants do not work well together Date: Mon, 01 Oct 2012 17:55:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pbrook at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: CC Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-10/txt/msg00047.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54303 Paul Brook changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pbrook at gcc dot gnu.org --- Comment #7 from Paul Brook 2012-10-01 17:55:28 UTC --- I believe the arm v.s. x86 differences are a red herring. You'll notice that one of the strings happens to be a multiple of 8 bytes long, so by default gcc chooses to align it, in the hope that we'll hit a fast patch in memcpy. On ARM we choose to use word alignment unconditionally for similar reasons. This is reasonable, the effectiveness of this alignment will depend on the performance characteristics of the str* and mem* functions. Arguably this is a linker bug. It should be able to remove unused elements from mergeable string sections.