From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 112169 invoked by alias); 22 Nov 2016 17:58:21 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 112155 invoked by uid 89); 22 Nov 2016 17:58:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.9 required=5.0 tests=AWL,BAYES_50,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=8:en, 8:ng, collector, 8:ki X-HELO: mail-io0-f179.google.com Received: from mail-io0-f179.google.com (HELO mail-io0-f179.google.com) (209.85.223.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 22 Nov 2016 17:58:09 +0000 Received: by mail-io0-f179.google.com with SMTP id j65so74049089iof.0 for ; Tue, 22 Nov 2016 09:58:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=qJJB9BwVBVeL7Cg+SMaXE2NGyPfQXUWQJudmbnoQfPA=; b=JP1MWhg6ygmJtdw01ISl6JykAVxV+EIhXgWyhjpFJyCod5ZopcJjkFiRX7u0UmWf2H lKO+kkv+MzBp1PMvQFH0oLP5N6nUDJKUQ5p3Dsaq2eMfS89zYnHzQnQgj4DbXNbJE0SN ScS/s8IcnsgaUt8cH57X1C9aHplVYVxGjfW31RMbLOMU0eoo5kEzlXDacY6V3dbC0IKa vW4N91lbrNPYTKlhZ/0N7BSdmweVJoliNaBoOloDHWJaHgqcU1pioMnTiD4v8zPMtPoc FpueCa9JBjxYVlDW8Uz/Ivxphs4e45Yd5DtI12+PwLYs4z23B7uKEFY+pGq0WDQK/KfA iECg== X-Gm-Message-State: AKaTC03mizEpJNwP5ZO2AG8ZFP+IJtMPx+Rir1W9qs6bGxG8GE7vCZwdymXoc39Fs1GC+/VWxhXLYlhl8Cy0Tg== X-Received: by 10.107.130.197 with SMTP id m66mr17604819ioi.38.1479837488172; Tue, 22 Nov 2016 09:58:08 -0800 (PST) MIME-Version: 1.0 Received: by 10.79.42.130 with HTTP; Tue, 22 Nov 2016 09:58:07 -0800 (PST) From: Ian Lance Taylor Date: Tue, 22 Nov 2016 17:58:00 -0000 Message-ID: Subject: Go patch committed: Rewrite panic/defer code from C to Go To: gcc-patches , "gofrontend-dev@googlegroups.com" Content-Type: multipart/mixed; boundary=001a113ed0e2cf1f190541e783ee X-SW-Source: 2016-11/txt/msg02259.txt.bz2 --001a113ed0e2cf1f190541e783ee Content-Type: text/plain; charset=UTF-8 Content-length: 805 This patch to the Go frontend and libgo rewrites the panic/defer code from C to Go. The actual stack unwind code is still in C, but the rest of the code, notably all the memory allocation, is now in Go. The names are changed to the names used in the Go 1.7 runtime, but the code is necessarily somewhat different. The __go_makefunc_can_recover function is dropped, as the uses of it were removed by Richard Henderson's work in https://golang.org/cl/198770044. This moves more memory allocation from C to Go, which will simplify the move to the new concurrent garbage collector. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian 2016-11-22 Ian Lance Taylor * go-gcc.cc (Gcc_backend::Gcc_backend): Add builtin function __builtin_frame_address. --001a113ed0e2cf1f190541e783ee Content-Type: text/plain; charset=UTF-8; name="patch.txt" Content-Disposition: attachment; filename="patch.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: f_ivtt0d0f0 Content-length: 103912 SW5kZXg6IGdjYy9nby9nby1nY2MuY2MKPT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PQotLS0gZ2NjL2dvL2dvLWdjYy5jYwkocmV2aXNpb24gMjQyNTgxKQorKysg Z2NjL2dvL2dvLWdjYy5jYwkod29ya2luZ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NzaW9uOjpkb19nZXRfYmFja2VuZCgK IAkvLyBiZWNhdXNlIGl0IGNoYW5nZXMgd2hldGhlciBpdCBjYW4gcmVjb3Zl ciBhIHBhbmljIG9yIG5vdC4KIAkvLyBTZWUgdGVzdDcgaW4gdGVzdC9yZWNv dmVyMS5nby4KICAgICAgICAgRXhwcmVzc2lvbiogcmVjb3ZlciA9IFJ1bnRp bWU6Om1ha2VfY2FsbCgodGhpcy0+aXNfZGVmZXJyZWQoKQotICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFJ1 bnRpbWU6OkRFRkVSUkVEX1JFQ09WRVIKLSAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBSdW50aW1lOjpSRUNP VkVSKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgPyBSdW50aW1lOjpERUZFUlJFRFJFQ09WRVIKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg OiBSdW50aW1lOjpHT1JFQ09WRVIpLAogICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvY2F0aW9uLCAwKTsKICAg ICAgICAgRXhwcmVzc2lvbiogY29uZCA9CiAgICAgICAgICAgICBFeHByZXNz aW9uOjptYWtlX2NvbmRpdGlvbmFsKGFyZywgcmVjb3ZlciwgbmlsLCBsb2Nh dGlvbik7CkluZGV4OiBnY2MvZ28vZ29mcm9udGVuZC9nb2dvLmNjCj09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT0KLS0tIGdjYy9nby9nb2Zyb250ZW5kL2dvZ28u Y2MJKHJldmlzaW9uIDI0MjU4MSkKKysrIGdjYy9nby9nb2Zyb250ZW5kL2dv Z28uY2MJKHdvcmtpbmcgY29weSkKQEAgLTQxNjgsO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SAodm9pZCAqKSAmbG9jc1tp XTsKKyAgICAgIHMuX19jb3VudCA9IG4gLSBpOworICAgICAgcy5fX2NhcGFj aXR5ID0gbiAtIGk7CisgICAgICBtYWtlZnVuY2ZmaWNhbnJlY292ZXIgKHMp OworICAgIH0KIAogICBGRklDYWxsYmFja0dvKHJlc3VsdHMsIGFyZ3MsIGNs b3N1cmUpOwogCiAgIGlmIChpIDwgbikKLSAgICBfX2dvX21ha2VmdW5jX3Jl dHVybmluZyAoKTsKKyAgICBtYWtlZnVuY3JldHVybmluZyAoKTsKIH0KIAog LyogQWxsb2NhdGUgYW4gRkZJIGNsb3N1cmUgYW5kIGFycmFuZ2UgdG8gY2Fs bCBmZmlfY2FsbGJhY2suICAqLwpJbmRleDogbGliZ28vZ28vcnVudGltZS9l cnJvci5nbwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBsaWJnby9nby9y dW50aW1lL2Vycm9yLmdvCShyZXZpc2lvbiAyNDI1ODEpCisrKyBsaWJnby9n by9ydW50aW1lL2Vycm9yLmdvCSh3b3JraW5nIGNvcHkpCkBAIC0xNDIsNyAr MTQyLDcgQEAgZnVuYyB0eXBlc3RyaW5nKHggaW50ZXJmYWNle30pIHN0cmlu ZyB7CiAvLyBQcmludHMgYW4gYXJndW1lbnQgcGFzc2VkIHRvIHBhbmljLgog Ly8gVGhlcmUncyByb29tIGZvciBhcmJpdHJhcnkgY29tcGxleGl0eSBoZXJl LCBidXQgd2Uga2VlcCBpdAogLy8gc2ltcGxlIGFuZCBoYW5kbGUganVzdCBh IGZldyBpbXBvcnRhbnQgY2FzZXM6IGludCwgc3RyaW5nLCBhbmQgU3RyaW5n ZXIuCi1mdW5jIFByaW50YW55KGkgaW50ZXJmYWNle30pIHsKK2Z1bmMgcHJp bnRhbnkoaSBpbnRlcmZhY2V7fSkgewogCXN3aXRjaCB2IDo9IGkuKHR5cGUp IHsKIAljYXN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l bSBzdGFjayIpCisJfQorCisJaWYgZ3AubS5tYWxsb2NpbmcgIT0gMCB7CisJ CXByaW50KCJwYW5pYzogIikKKwkJcHJpbnRhbnkoZSkKKwkJcHJpbnQoIlxu IikKKwkJdGhyb3coInBhbmljIGR1cmluZyBtYWxsb2MiKQorCX0KKwlpZiBn cC5tLnByZWVtcHRvZmYgIT0gIiIgeworCQlwcmludCgicGFuaWM6ICIpCisJ CXByaW50YW55KGUpCisJCXByaW50KCJcbiIpCisJCXByaW50KCJwcmVlbXB0 IG9mZiByZWFzb246ICIpCisJCXByaW50KGdwLm0ucHJlZW1wdG9mZikKKwkJ cHJpbnQoIlxuIikKKwkJdGhyb3coInBhbmljIGR1cmluZyBwcmVlbXB0b2Zm IikKKwl9CisJaWYgZ3AubS5sb2NrcyAhPSAwIHsKKwkJcHJpbnQoInBhbmlj OiAiKQorCQlwcmludGFueShlKQorCQlwcmludCgiXG4iKQorCQl0aHJvdygi cGFuaWMgaG9sZGluZyBsb2NrcyIpCisJfQorCisJdmFyIHAgX3BhbmljCisJ cC5hcmcgPSBlCisJcC5saW5rID0gZ3AuX3BhbmljCisJZ3AuX3BhbmljID0g KCpfcGFuaWMpKG5vZXNjYXBlKHVuc2FmZS5Qb2ludGVyKCZwKSkpCisKKwlm b3IgeworCQlkIDo9IGdwLl9kZWZlcgorCQlpZiBkID09IG5pbCB7CisJCQli cmVhaworCQl9CisKKwkJcGZuIDo9IGQucGZuCisJCWQucGZuID0gMAorCisJ CWlmIHBmbiAhPSAwIHsKKwkJCXZhciBmbiBmdW5jKHVuc2FmZS5Qb2ludGVy KQorCQkJKigqKnVpbnRwdHIpKHVuc2FmZS5Qb2ludGVyKCZmbikpID0gJnBm bgorCQkJZm4oZC5hcmcpCisKKwkJCWlmIHAucmVjb3ZlcmVkIHsKKwkJCQkv LyBTb21lIGRlZmVycmVkIGZ1bmN0aW9uIGNhbGxlZCByZWNvdmVyLgorCQkJ CS8vIFN0b3AgcnVubmluZyB0aGlzIHB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ICAgIHJldC5fdHlwZSA9IE5V TEw7Ci0gICAgICByZXQuZGF0YSA9IE5VTEw7Ci0gICAgICByZXR1cm4gcmV0 OwotICAgIH0KLSAgcCA9IGctPl9wYW5pYzsKLSAgcC0+cmVjb3ZlcmVkID0g MTsKLSAgcmV0dXJuIHAtPmFyZzsKLX0KSW5kZXg6IGxpYmdvL3J1bnRpbWUv Z28tc2lnbmFsLmMKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gbGliZ28v cnVudGltZS9nby1zaWduYWwuYwkocmV2aXNpb24gMjQyNTgxKQorKysgbGli Z28vcnVudGltZS9nby1zaWduYWwuYwkod29ya2luZyBjb3B5KQpAQCAtMTEs OCArMTEsNiBAQAogI2luY2x1ZGUgPHVjb250ZXh0Lmg+CiAKICNpbmNsdWRl ICJydW50aW1lLmgiCi0jaW5jbHVkZSAiZ28tYXNzZXJ0LmgiCi0jaW5jbHVk ZSAiZ28tcGFuaWMuaCIKIAogI2lmbmRlZiBTQV9SRVNUQVJUCiAgICNkZWZp bmUgU0FfUkVTVEFSVCAwCkluZGV4OiBsaWJnby9ydW50aW1lL2dvLXN0cnNs aWNlLmMKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gbGliZ28vcnVudGlt ZS9nby1zdHJzbGljZS5jCShyZXZpc2lvbiAyNDI1ODEpCisrKyBsaWJnby9y dW50aW1lL2dvLXN0cnNsaWNlLmMJKHdvcmtpbmcgY29weSkKQEAgLTUsOSAr NSw2IEBACiAgICBsaWNlbnNlIHRoYXQgY2FuIGJlIGZvdW5kIGluIHRoZSBM SUNFTlNFIGZpbGUuICAqLwogCiAjaW5jbHVkZSAicnVudGltZS5oIgotI2lu Y2x1ZGUgImdvLXBhbmljLmgiCi0jaW5jbHVkZSAiYXJjaC5oIgotI2luY2x1 ZGUgIm1hbGxvYy5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