From patchwork Wed Feb 15 08:09:07 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 141263 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 46C8B1007D4 for ; Wed, 15 Feb 2012 19:13: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=1329898440; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:From:To:Subject:Date:User-Agent:MIME-Version:Message-Id: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=RTWwmbY pHsP3hkK4Bak3gqaAztA=; b=i9Q4q1+y5Q3WvUqg8tsNjGpEZr20Wy9xUEhHuHD V+E0CxxNKaMAP3lZmcSu1ChmxDaDWnJUaAK3a3GvSi7DaLiIIpvNE5bChHR3xRiA hd5Jqv925FvMYaC6Dvi9UE0q913w/k8jmCu6u0g8MMy1vlnv5a4SUDPdqX0we5ni XPAY= 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:Received:Received:From:To:Subject:Date:User-Agent:MIME-Version:Message-Id:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=ZhyEaQxA0DzgbwYaFEJuhj2IrIE2x2v95n+M6i3mu/kvRnqQZH6bb8HRqyEaee JSzww3rVoAw3DfV44b0XZhGnymyBcRVYeeNehkmtc2flajURa+bIIxVgjMw+GEKI YoAAO0A1qwg3eTGF+jUTyk8MXWNc26iQ2KMxKhVFgyv90=; Received: (qmail 26384 invoked by alias); 15 Feb 2012 08:13:53 -0000 Received: (qmail 26375 invoked by uid 22791); 15 Feb 2012 08:13:51 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 15 Feb 2012 08:13:38 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 2195029007C for ; Wed, 15 Feb 2012 09:13:38 +0100 (CET) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hcKB+BP9Pszf for ; Wed, 15 Feb 2012 09:13:38 +0100 (CET) Received: from [192.168.1.2] (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id D292C290007 for ; Wed, 15 Feb 2012 09:13:37 +0100 (CET) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: Fix PR target/51921 Date: Wed, 15 Feb 2012 09:09:07 +0100 User-Agent: KMail/1.9.9 MIME-Version: 1.0 Message-Id: <201202150909.07090.ebotcazou@adacore.com> 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 This fixes the regression in the frame unwinding support on SPARC/Solaris 11 present on the mainline and 4.6 branch. Tested (by me) on 6 differents OS versions of Solaris 8, 9 and 10 and on Solaris 11 by Ian and Rainer. Applied on the mainline and 4.6 branch. 2012-02-15 Eric Botcazou PR target/51921 PR target/52205 * config/sparc/sol2-unwind.h (sparc64_is_sighandler): Add support for Solaris 11 and slightly reformat. (sparc_is_sighandler): Likewise. Index: config/sparc/sol2-unwind.h =================================================================== --- config/sparc/sol2-unwind.h (revision 183864) +++ config/sparc/sol2-unwind.h (working copy) @@ -119,7 +119,12 @@ sparc64_is_sighandler (unsigned int *pc, unsigned int cuh_pattern = *(unsigned int *)(*(unsigned long *)(cfa + 15*8) - 4); - if (cuh_pattern == 0xd25fa7ef) + if (cuh_pattern == 0x92100019) + /* This matches the call_user_handler pattern for Solaris 11. + This is the same setup as for Solaris 9, see below. */ + *nframes = 3; + + else if (cuh_pattern == 0xd25fa7ef) { /* This matches the call_user_handler pattern for Solaris 10. There are 2 cases so we look for the return address of the @@ -140,6 +145,7 @@ sparc64_is_sighandler (unsigned int *pc, */ *nframes = 2; } + else if (cuh_pattern == 0x9410001a || cuh_pattern == 0x94100013) /* This matches the call_user_handler pattern for Solaris 9 and for Solaris 8 running inside Solaris Containers respectively @@ -152,7 +158,8 @@ sparc64_is_sighandler (unsigned int *pc, */ *nframes = 3; - else + + else /* cuh_pattern == 0xe0272010 */ /* This is the default Solaris 8 case. We need to move up two frames: @@ -162,6 +169,7 @@ sparc64_is_sighandler (unsigned int *pc, */ *nframes = 2; + return 1; } @@ -296,7 +304,12 @@ sparc_is_sighandler (unsigned int *pc, v unsigned int cuh_pattern = *(unsigned int *)(*(unsigned int *)(cfa + 15*4) - 4); - if (cuh_pattern == 0xd407a04c) + if (cuh_pattern == 0x92100019) + /* This matches the call_user_handler pattern for Solaris 11. + This is the same setup as for Solaris 9, see below. */ + *nframes = 3; + + else if (cuh_pattern == 0xd407a04c) { /* This matches the call_user_handler pattern for Solaris 10. There are 2 cases so we look for the return address of the @@ -317,6 +330,7 @@ sparc_is_sighandler (unsigned int *pc, v */ *nframes = 2; } + else if (cuh_pattern == 0x9410001a || cuh_pattern == 0x9410001b) /* This matches the call_user_handler pattern for Solaris 9 and for Solaris 8 running inside Solaris Containers respectively. @@ -329,7 +343,8 @@ sparc_is_sighandler (unsigned int *pc, v */ *nframes = 3; - else + + else /* cuh_pattern == 0x90100018 */ /* This is the default Solaris 8 case. We need to move up two frames: @@ -339,6 +354,7 @@ sparc_is_sighandler (unsigned int *pc, v */ *nframes = 2; + return 1; }