From patchwork Wed Jul 4 12:39:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 168978 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 4FD0A2C007F for ; Wed, 4 Jul 2012 22:40:17 +1000 (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=1342010418; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Date: From:To:Cc:Subject:Message-ID:User-Agent:MIME-Version: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=UDg8hnX hPZ9aZfhP2F2iRLAKiFs=; b=PTmmtIef0nnAbTOVp+/8lBRqPf5LKfbAqe71RD0 Ft4e1txzfBYlHgPoAiyWju/m2bXurAaYy1Qrq2j7/tHxfUyiHXEEQ1NY7auWLWqt IKu/e3ks4r40emFXmWb3KKUDx9h0Kzyd9JU4oliL17A09+mJtwPvy+99cpbDj+Ij tCgE= 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:Date:From:To:Cc:Subject:Message-ID:User-Agent:MIME-Version:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=YHrguleRPv+Cw93piJv8yQGITKslrKKUrXzYcYzinDHlnRHPpKbvexbPibxSwO ylLpAV2Qcgl4y7Ntr0itju8zbrXhulqyoWECL1RnYgcsN/97xSTOVTJEda0CjkC7 Ja8owWqweCyhWaq/vZBlwHBeJVG+kneZCljiq5nGwyaIk=; Received: (qmail 8851 invoked by alias); 4 Jul 2012 12:40:13 -0000 Received: (qmail 8838 invoked by uid 22791); 4 Jul 2012 12:40:12 -0000 X-SWARE-Spam-Status: No, hits=-5.3 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 04 Jul 2012 12:39:59 +0000 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id EB766A5271 for ; Wed, 4 Jul 2012 14:39:58 +0200 (CEST) Date: Wed, 4 Jul 2012 14:39:58 +0200 (CEST) From: Richard Guenther To: gcc-patches@gcc.gnu.org Cc: Jan Hubicka Subject: [PATCH] Fix PR53433, LTO and constant folding confused about error_mark_node Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 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 In initializer constant folding we use error_mark_node as a magic return value which indicates a not present but kown zero initializer. LTO on the other hand uses error_mark_node to mark something as having a non-empty initializer but not present in the current ltrans unit. Those uses conflict - thus avoid leaking the latter into the former. Bootstrap and regtest ongoing on x86_64-unknown-linux-gnu (it is confirmed that it fixes the LTO profiledbootstrap case). I'll apply this to all affected branches once tested. Thanks, Richard. 2012-07-04 Richard Guenther PR middle-end/53433 * gimple-fold.c (get_base_constructor): Do not return an error_mark_node DECL_INITIAL. Index: gcc/gimple-fold.c =================================================================== --- gcc/gimple-fold.c (revision 189251) +++ gcc/gimple-fold.c (working copy) @@ -2713,6 +2713,10 @@ get_base_constructor (tree base, HOST_WI if (!DECL_INITIAL (base) && (TREE_STATIC (base) || DECL_EXTERNAL (base))) return error_mark_node; + /* Do not return an error_mark_node DECL_INITIAL. LTO uses this + as special marker (_not_ zero ...) for its own purposes. */ + if (DECL_INITIAL (base) == error_mark_node) + return NULL_TREE; return DECL_INITIAL (base); case ARRAY_REF: