From patchwork Sun Sep 28 15:48:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John David Anglin X-Patchwork-Id: 394191 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 798F2140096 for ; Mon, 29 Sep 2014 01:48:50 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:from:to:content-type:subject:mime-version:date; q= dns; s=default; b=hzHgnjzwUDloBEeh5EaOquJgL00YCUMjZOt7fgnNPJGR+7 JJteEUTOsNAWfbUjMmulheCpIdnLa+UXPDm6//hu+oQ1RAYrg+kR1I3p02yXUXqN NnSAYy7d+VJtvwEdNlffGkwq4lDfVv31VZpIAgnhpn3ch7Raejt6Xq1iAW0o4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:from:to:content-type:subject:mime-version:date; s= default; bh=yvsz9DCKUAfVpXsqPlSEXy3KcuQ=; b=upA6RE2NsAkcjMhWEimd 0pv17E/V3rjXEFNbqqBcL0in/EltN8tVTjnwevfcb0iPz7WGh6cSFCFc54ZlUIot jJAM5Yb82Rq3MF8V+NkGJQG4wdiBeRLCVwtC7IkVb2e7c8lAPZ4toJJuvZSCMhU8 TJgOtlW4H0CBM2BZQtkeAIg= Received: (qmail 7060 invoked by alias); 28 Sep 2014 15:48:43 -0000 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 Received: (qmail 7044 invoked by uid 89); 28 Sep 2014 15:48:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 X-HELO: BLU004-OMC3S33.hotmail.com Received: from blu004-omc3s33.hotmail.com (HELO BLU004-OMC3S33.hotmail.com) (65.55.116.108) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA256 encrypted) ESMTPS; Sun, 28 Sep 2014 15:48:40 +0000 Received: from BLU436-SMTP100 ([65.55.116.72]) by BLU004-OMC3S33.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.22724); Sun, 28 Sep 2014 08:48:38 -0700 X-TMN: [QB1v3rtWHsALJM8orrjSAT9PzxOwlW5J] Message-ID: From: John David Anglin To: GCC Patches Subject: [committed] Fix ICE in pa_output_function_epilogue MIME-Version: 1.0 (Apple Message framework v936) Date: Sun, 28 Sep 2014 11:48:21 -0400 The attached change fixes a segmentation fault that occurs building llvm-toolchain-3.4. Tested on hppa-unknown-linux-gnu. Committed to trunk, 4.9 and 4.8 branches. Dave --- John David Anglin dave.anglin@bell.net 2014-09-28 John David Anglin * config/pa/pa.c (pa_output_function_epilogue): Only update last_address when a nonnote insn is found. Index: config/pa/pa.c =================================================================== --- config/pa/pa.c (revision 215649) +++ config/pa/pa.c (working copy) @@ -4208,9 +4208,12 @@ { last_address = extra_nop ? 4 : 0; insn = get_last_nonnote_insn (); - last_address += INSN_ADDRESSES (INSN_UID (insn)); - if (INSN_P (insn)) - last_address += insn_default_length (insn); + if (insn) + { + last_address += INSN_ADDRESSES (INSN_UID (insn)); + if (INSN_P (insn)) + last_address += insn_default_length (insn); + } last_address = ((last_address + FUNCTION_BOUNDARY / BITS_PER_UNIT - 1) & ~(FUNCTION_BOUNDARY / BITS_PER_UNIT - 1)); }