From patchwork Fri Dec 10 19:49:49 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 75131 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 39176B70A9 for ; Sat, 11 Dec 2010 06:49:59 +1100 (EST) Received: (qmail 15218 invoked by alias); 10 Dec 2010 19:49:57 -0000 Received: (qmail 15206 invoked by uid 22791); 10 Dec 2010 19:49:56 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 10 Dec 2010 19:49:52 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oBAJnokP018792 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 10 Dec 2010 14:49:51 -0500 Received: from tyan-ft48-01.lab.bos.redhat.com (tyan-ft48-01.lab.bos.redhat.com [10.16.42.4]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id oBAJnoe1008645 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 10 Dec 2010 14:49:50 -0500 Received: from tyan-ft48-01.lab.bos.redhat.com (localhost.localdomain [127.0.0.1]) by tyan-ft48-01.lab.bos.redhat.com (8.14.4/8.14.4) with ESMTP id oBAJnnRj018229 for ; Fri, 10 Dec 2010 20:49:49 +0100 Received: (from jakub@localhost) by tyan-ft48-01.lab.bos.redhat.com (8.14.4/8.14.4/Submit) id oBAJnnnD018228 for gcc-patches@gcc.gnu.org; Fri, 10 Dec 2010 20:49:49 +0100 Date: Fri, 10 Dec 2010 20:49:49 +0100 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Subject: [PATCH] Avoid setting first GIMPLE_DEBUG operand to MEM_REF in lto streaming (PR lto/46879) Message-ID: <20101210194949.GT29412@tyan-ft48-01.lab.bos.redhat.com> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) 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 Hi! The first operand of GIMPLE_DEBUG must be a DECL, not a MEM_REF, so the DECL -> MEM_REF replacement output_gimple_stmt does is wrong for it. Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2010-12-10 Jakub Jelinek PR lto/46879 * lto-streamer-out.c (output_gimple_stmt): Never replace first GIMPLE_DEBUG argument with MEM_REF. Jakub --- gcc/lto-streamer-out.c.jj 2010-12-02 11:51:31.000000000 +0100 +++ gcc/lto-streamer-out.c 2010-12-10 17:13:32.000000000 +0100 @@ -1759,8 +1759,9 @@ output_gimple_stmt (struct output_block tree op = gimple_op (stmt, i); /* Wrap all uses of non-automatic variables inside MEM_REFs so that we do not have to deal with type mismatches on - merged symbols during IL read in. */ - if (op) + merged symbols during IL read in. The first operand + of GIMPLE_DEBUG must be a decl, not MEM_REF, though. */ + if (op && (i || !is_gimple_debug (stmt))) { tree *basep = &op; while (handled_component_p (*basep))