From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3512 invoked by alias); 6 Oct 2014 19:01:39 -0000 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 Received: (qmail 3475 invoked by uid 55); 6 Oct 2014 19:01:35 -0000 From: "hubicka at ucw dot cz" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/63435] Bad code with weak vs localalias on AIX Date: Mon, 06 Oct 2014 19:01:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 4.9.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hubicka at ucw dot cz X-Bugzilla-Status: NEW 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: In-Reply-To: References: 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: 2014-10/txt/msg00422.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63435 --- Comment #5 from Jan Hubicka --- There are three problems in 4.9 and earlier - the aliases are produced incorrectly because AIX's as alias keyword does not do what is expected (it does kind of syntactic replacement combined with something else) - MAKE_ONE_ONLY is not defined making compiler to believe that linker does not perfrom garbage collection - Linker's garbage collection was disabled, so in particular all duplicated comdats stays in the code. Lack of MAKE_ONE_ONLY makes GCC to produce a lot more local aliases, because it makes sense to refer to a function by local relocation instead of lgobal when we know it is going to stay. Together with the as issue this leads to wrong code. You can work around by forcing local alias to return NULL for AIX to disable some of local aliases. There are other two cases where GCC produce such symbols (in addition of user declaring it by hand in source code via the alias attribute). It is the thunk generation (I suppose this one works as it is there for ages) and the new comdat local code in C++ (that is used only by -Os codegen path at 4.9).