[{"id":1769974,"web_url":"http://patchwork.ozlabs.org/comment/1769974/","msgid":"<20170918083030.GF1701@tucnak>","list_archive_url":null,"date":"2017-09-18T08:30:30","subject":"Re: [patch] Fix PR target/81361","submitter":{"id":671,"url":"http://patchwork.ozlabs.org/api/people/671/","name":"Jakub Jelinek","email":"jakub@redhat.com"},"content":"On Mon, Sep 18, 2017 at 09:50:45AM +0200, Eric Botcazou wrote:\n> .set L$set$24,LEFDE3-LASFDE3\n> \t.long L$set$24\t# FDE Length\n> LASFDE3:\n> \t.long\tLASFDE3-EH_frame1\t# FDE CIE offset\n> \t.quad\tLCOLDB1-.\t# FDE initial location\n> \t.set L$set$25,LCOLDE1-LCOLDB1\n> \t.quad L$set$25\t# FDE address range\n> \t.byte\t0x8\t# uleb128 0x8; Augmentation size\n> \t.quad\tLLSDAC5-.\t# Language Specific Data Area\n> \t.byte\t0x1\t# DW_CFA_set_loc\n> \t.quad\tLCFI1-.\n> \t.byte\t0xe\t# DW_CFA_def_cfa_offset\n> \t.byte\t0x10\t# uleb128 0x10\n> \t.byte\t0x83\t# DW_CFA_offset, column 0x3\n> \t.byte\t0x2\t# uleb128 0x2\n> \n> Note the DW_CFA_set_loc operation: it's the only case where the compiler emits \n> it (DW_CFA_advance_loc4 is usually emitted) and is the source of the problem, \n> since it appears that the PC-relative relocation is not applied to the operand \n> of the DW_CFA_set_loc (unlike to the 2 other cases in the FDE).\n\nThat sounds like a Darwin bug in handling of DW_CFA_set_loc in .eh_frame\nsection, the encoding/size of the DW_CFA_set_loc operand is an encoded\npointer, always absolute address in .debug_frame section, and whatever the\nCIE augmentation says should be used otherwise, i.e. the same as e.g. FDE\ninitial location pointer.  As that is LCOLDB1-. in the same FDE, it means\nLCFI1-. is right.\n\nThat said, there is indeed no reason to emit DW_CFA_set_loc when we have a\nlabel, so your patch is ok for trunk.  That doesn't mean Darwin shouldn't be\nfixed.  libgcc unwind-dw2.c for DW_CFA_set_loc uses read_encoded_value\nand so I believe should DTRT.\n\n> This DW_CFA_set_loc instruction is emitted by add_cfis_to_fde for the second \n> FDE generated for the cold part of a function but doesn't seem necessary any \n> more, since there is a label (LCOLDB1) to be used now (this can also be seen \n> on Linux with the -fno-dwarf2-cfi-asm option).\n> \n> Bootstrapped/regtested on x86-64/Linux by me and various versions of Darwin by \n> Iain, Dominique and myself.  OK for the mainline?\n> \n> \n> 2017-09-18  Eric Botcazou  <ebotcazou@adacore.com>\n> \n> \tPR target/81361\n> \t* dwarf2cfi.c (add_cfis_to_fde): Do not generate DW_CFA_set_loc\n> \tafter switching to a new text section.\n\n\tJakub","headers":{"Return-Path":"<gcc-patches-return-462356-incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","mailing list gcc-patches@gcc.gnu.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=gcc-patches-return-462356-incoming=patchwork.ozlabs.org@gcc.gnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org\n\theader.b=\"MhG4REp2\"; dkim-atps=neutral","sourceware.org; auth=none","ext-mx08.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx08.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=jakub@redhat.com"],"Received":["from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xwfNG0l5zz9rxm\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 18 Sep 2017 18:30:53 +1000 (AEST)","(qmail 18774 invoked by alias); 18 Sep 2017 08:30:39 -0000","(qmail 17333 invoked by uid 89); 18 Sep 2017 08:30:38 -0000","from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by\n\tsourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP;\n\tMon, 18 Sep 2017 08:30:37 +0000","from smtp.corp.redhat.com\n\t(int-mx03.intmail.prod.int.phx2.redhat.com\n\t[10.5.11.13])\t(using TLSv1.2 with cipher AECDH-AES256-SHA\n\t(256/256 bits))\t(No client certificate requested)\tby\n\tmx1.redhat.com (Postfix) with ESMTPS id 2C448C057FAF;\n\tMon, 18 Sep 2017 08:30:35 +0000 (UTC)","from tucnak.zalov.cz (ovpn-116-102.ams2.redhat.com\n\t[10.36.116.102])\tby smtp.corp.redhat.com (Postfix) with\n\tESMTPS id B64386060C; Mon, 18 Sep 2017 08:30:34 +0000 (UTC)","from tucnak.zalov.cz (localhost [127.0.0.1])\tby tucnak.zalov.cz\n\t(8.15.2/8.15.2) with ESMTP id v8I8UWMT031024;\n\tMon, 18 Sep 2017 10:30:32 +0200","(from jakub@localhost)\tby tucnak.zalov.cz (8.15.2/8.15.2/Submit)\n\tid v8I8UU3K031023; Mon, 18 Sep 2017 10:30:30 +0200"],"DomainKey-Signature":"a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender:date\n\t:from:to:cc:subject:message-id:reply-to:references:mime-version\n\t:content-type:in-reply-to; q=dns; s=default; b=EXdDbrfjPutQKF0U3\n\tQhsIzv82qARfjH//ndV//nW5jEfemxWMCaTWHsR0b/MXWyA8oxWqI3K3NUm/JWUP\n\tiBU0kTzeVIdBV9BLtk+5snhYXjdJJ7u77TRpeVWMESEzzV4cvLBFfsQgt72GaeHw\n\tEPup/QxOhvx5qJREu5FeKaaDG4=","DKIM-Signature":"v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender:date\n\t:from:to:cc:subject:message-id:reply-to:references:mime-version\n\t:content-type:in-reply-to; s=default; bh=y7io0peOubQid9zDGRSiB9v\n\tK5gs=; b=MhG4REp2n0hO+oNnzuMQJV1iqe+fMeS3+DSgcvFoJyXO0Us51JmUA2t\n\t/FwVtQkp3S1rpziAl2bTMjlbN247sl/HEO5YGC1sujQV53ChimNcGjLvb/p8cxWm\n\tcduE+6qBiwre9XwXE+4HZhwCATg8WGlb9Q+zwq/vjSj+DrBUW5yM=","Mailing-List":"contact gcc-patches-help@gcc.gnu.org; run by ezmlm","Precedence":"bulk","List-Id":"<gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<mailto:gcc-patches-unsubscribe-incoming=patchwork.ozlabs.org@gcc.gnu.org>","List-Archive":"<http://gcc.gnu.org/ml/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-help@gcc.gnu.org>","Sender":"gcc-patches-owner@gcc.gnu.org","X-Virus-Found":"No","X-Spam-SWARE-Status":"No, score=-0.9 required=5.0 tests=BAYES_00,\n\tKAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD,\n\tSPF_HELO_PASS autolearn=no version=3.3.2 spammy=","X-HELO":"mx1.redhat.com","DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 2C448C057FAF","Date":"Mon, 18 Sep 2017 10:30:30 +0200","From":"Jakub Jelinek <jakub@redhat.com>","To":"Eric Botcazou <ebotcazou@adacore.com>","Cc":"gcc-patches@gcc.gnu.org","Subject":"Re: [patch] Fix PR target/81361","Message-ID":"<20170918083030.GF1701@tucnak>","Reply-To":"Jakub Jelinek <jakub@redhat.com>","References":"<2507479.MzcqCaxoQO@polaris>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<2507479.MzcqCaxoQO@polaris>","User-Agent":"Mutt/1.7.1 (2016-10-04)","X-IsSubscribed":"yes"}}]