From patchwork Wed Apr 24 09:39:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Schmidt X-Patchwork-Id: 239115 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 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id BA01A2C0132 for ; Wed, 24 Apr 2013 19:40:19 +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:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=KCMKHmkGh2FM99+SNq4Xkwp7PF9CIOnG1jTI1AjaTuhXrS oH3aIaffydPyFhd9rYPxi3DbdOXGbzlDhryKa2sUQkjGKTolpkv35dbi0jjNz8e9 Iw32pmyyz5bMI/7TP+cRHCI49iYKtxnz0b5SQ5ByHAGJxRVjy4yv3xrgxM3XA= 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:date:from:mime-version:to:subject:content-type; s= default; bh=wQkhf17B3qembvPh4XCiov/WT5E=; b=LaPygfkGrvvTqqV/CPjx GMJX27Wji7hV1PbR2CZngBs6OiSRNxU2Ic61KW6jMvIHFHbMGVc96CWHT99wVI4+ dIZt5UA6T4RYSNmS7NKJ8skm3lU2kzF0CXU9XA/LFPK4y3c51UZJzE8DQ5mFgkGg 7XTg7BVuF1iykmPZ58qOCUo= Received: (qmail 20360 invoked by alias); 24 Apr 2013 09:40:12 -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 20349 invoked by uid 89); 24 Apr 2013 09:40:11 -0000 X-Spam-SWARE-Status: No, score=-3.7 required=5.0 tests=AWL, BAYES_00, FROM_12LTRDOM, KHOP_RCVD_UNTRUST, RCVD_IN_HOSTKARMA_W, RCVD_IN_HOSTKARMA_WL, TW_DW autolearn=no version=3.3.1 Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 24 Apr 2013 09:40:11 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1UUwBN-0006sM-3k from Bernd_Schmidt@mentor.com for gcc-patches@gcc.gnu.org; Wed, 24 Apr 2013 02:40:09 -0700 Received: from SVR-IES-FEM-02.mgc.mentorg.com ([137.202.0.106]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Wed, 24 Apr 2013 02:40:08 -0700 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-02.mgc.mentorg.com (137.202.0.106) with Microsoft SMTP Server id 14.2.247.3; Wed, 24 Apr 2013 10:40:05 +0100 Message-ID: <5177A86E.5000107@codesourcery.com> Date: Wed, 24 Apr 2013 11:39:58 +0200 From: Bernd Schmidt User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130413 Thunderbird/17.0.5 MIME-Version: 1.0 To: GCC Patches Subject: PR 50686: dwarf2cfi fix for IRIX X-Virus-Found: No Before the target was removed, IRIX defined DWARF_FRAME_RETURN_COLUMN to be reg 64, which is something other than INCOMING_RETURN_ADDR_RTX (reg 31). This means that when we see a save of reg 31, we discover that this is really a save of reg 64 and produce dwarf information accordingly. However, there is nothing that handles a restore of reg 31 specially, which means that reg 64 is unaffected by it. This is a problem when shrink-wrapping, if we end up merging two paths where one can arrive directly from the function start, and another where we've gone through a save/restore of reg 31. The paths will disagree on where reg 64 is saved. The following patch fixes it by handling restores of INCOMING_RETURN_ADDR_RTX specially if it is different from DWARF_FRAME_RETURN_COLUMN. Bootstrapped and tested on x86_64-linux, and also bootstrapped by Rainer Orth on IRIX with 4.7.3. Ok? Bernd * dwarf2cfi.c (dwarf2out_frame_debug_cfa_restore): When restoring INCOMING_RETURN_ADDR_RTX, and it is different from DWARF_FRAME_RETURN_COLUMN, mark the latter as saved in the former. Index: gcc/dwarf2cfi.c =================================================================== --- gcc/dwarf2cfi.c (revision 189425) +++ gcc/dwarf2cfi.c (working copy) @@ -1240,6 +1240,10 @@ dwarf2out_frame_debug_cfa_restore (rtx r add_cfi_restore (regno); update_row_reg_save (cur_row, regno, NULL); + if (REG_P (INCOMING_RETURN_ADDR_RTX) + && regno == dwf_regno (INCOMING_RETURN_ADDR_RTX) + && regno != DWARF_FRAME_RETURN_COLUMN) + reg_save (DWARF_FRAME_RETURN_COLUMN, regno, 0); } /* A subroutine of dwarf2out_frame_debug, process a REG_CFA_WINDOW_SAVE.