From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24806 invoked by alias); 23 Jul 2014 13:37:57 -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 24716 invoked by uid 48); 23 Jul 2014 13:37:47 -0000 From: "hubicka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug lto/61886] [4.8/4.9/4.10 Regression] LTO breaks fread with _FORTIFY_SOURCE=2 Date: Wed, 23 Jul 2014 13:37:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: lto X-Bugzilla-Version: 4.9.1 X-Bugzilla-Keywords: diagnostic, lto, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: hubicka at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: hubicka at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on assigned_to everconfirmed 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-07/txt/msg01571.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61886 Jan Hubicka changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |ASSIGNED Last reconfirmed| |2014-07-23 Assignee|unassigned at gcc dot gnu.org |hubicka at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #5 from Jan Hubicka --- This is a difficult problem. In early cgraph days GCC code was converted to assume that there are never duplicated declarations of a given symbol. This is precisely what glibc does to keep these duplicates flow through the compilation. It is a long standing bug that we have such duplicate declarations and that we do not reject these as an error or fix internaly. A clear fix would be to make alias from glibc SO for fread_chk and fread_chk_warn that can be used for those two different calls. But without changling glibc's API we need to work out how to introduce the alias internally. We support similar bookeeping for wearkrefs that are "syntactic" aliases resulting in the same assembler name as their target. I suppose we can do the same here, but it is ugly - I would much preffer those hacks to not exist at all. I will try to prepare patch and see how contained it is. Honza