From patchwork Tue Jan 17 09:35:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 136433 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 286EC1007D2 for ; Tue, 17 Jan 2012 20:35:59 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1327397760; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Received:In-Reply-To:References:Date: Message-ID:Subject:From:To:Cc:Content-Type: Content-Transfer-Encoding:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=z19f6xD9ujA/8Kolm+FoFK1AcoA=; b=FR/xyZMmPs2DtKI ZQ1CrCKioFsqzKOk0SWc6tja7ARe0xqrAtdCyvjb23+pJ9Iwv1YvJ9bW6d22icZ9 iKC+DaLAPsyLjc+wTxcIsmXlnhQsNf1EkfK/I2AaKdGfVv0X58t5Zuhf7Uqa9UD3 a4GDvY4gUMfco2D+/uAyuMBrrnNE= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:MIME-Version:Received:Received:In-Reply-To:References:Date:Message-ID:Subject:From:To:Cc:Content-Type:Content-Transfer-Encoding:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=rG3AN0JCw0oMXd2H97T56brokY4SEihgvJQemADsHwE1McBAbIagNT+mE/gwUs dmGkcXpWHzsSPumxvhvbBzaj+nRSymuVbbBLvlIZM/NJ+LjK7tmzmlDDT8WWJ05X 1VkiKMSeseW7apWei0v98CtBkng3p2ls703bSSQGpljuE=; Received: (qmail 26032 invoked by alias); 17 Jan 2012 09:35:56 -0000 Received: (qmail 25867 invoked by uid 22791); 17 Jan 2012 09:35:55 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-tul01m020-f175.google.com (HELO mail-tul01m020-f175.google.com) (209.85.214.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 17 Jan 2012 09:35:36 +0000 Received: by obcwo8 with SMTP id wo8so3261732obc.20 for ; Tue, 17 Jan 2012 01:35:36 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.36.35 with SMTP id n3mr14281183obj.66.1326792936083; Tue, 17 Jan 2012 01:35:36 -0800 (PST) Received: by 10.182.60.39 with HTTP; Tue, 17 Jan 2012 01:35:36 -0800 (PST) In-Reply-To: <4F1496D1.4090502@redhat.com> References: <4F1496D1.4090502@redhat.com> Date: Tue, 17 Jan 2012 10:35:36 +0100 Message-ID: Subject: Re: C++ PATCH for c++/51827 (mangling error with PCH and LTO) From: Richard Guenther To: Jason Merrill Cc: gcc-patches List X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On Mon, Jan 16, 2012 at 10:29 PM, Jason Merrill wrote: > When outputting PCH/LTO, the compiler tries to generate mangled names for > all decls before discarding language-specific data.  But that doesn't make > sense for templates, and leads to conflicts in this case. Fixed by refusing > to mangle templates. > > Tested x86_64-pc-linux-gnu, applying to trunk. Hmm. Using -flto when generating a precompiled header doesn't make sense. We probably should drop -flto silently or complain here. Thus, any objection to that? Thanks, Richard. Index: c-family/c-opts.c =================================================================== --- c-family/c-opts.c (revision 183205) +++ c-family/c-opts.c (working copy) @@ -1058,6 +1058,13 @@ c_common_post_options (const char **pfil && flag_preprocess_only && !flag_no_line_commands) pp_dir_change (parse_in, get_src_pwd ()); + /* Disable LTO output when outputting a precompiled header. */ + if (pch_file && flag_lto) + { + flag_lto = 0; + flag_generate_lto = 0; + } + return flag_preprocess_only; }