From patchwork Sun Jan 21 23:13:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 864114 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-471773-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="m8qJz9Fw"; dkim-atps=neutral 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 3zPr3L08bmz9sBW for ; Mon, 22 Jan 2018 10:13:48 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:cc:content-type; q=dns; s=default; b=EBY8VKV61ft/FHrBgOyOdc+pKUvbg2GRgsd3QE+uxai riZQscVtzjy6ThbejdTST56gvTTLFhBj/ZOMs8y4ptJ7bT3D9KqRU5vy1gheyDdu 5H69S6x5EJnX3cgo7x2LqOcALA/QyU5plgbvrQsVOHHc6JZOhjTAubIxWcsZc67w = 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 :mime-version:from:date:message-id:subject:to:cc:content-type; s=default; bh=r84/PiJZMi95TPnVPBqUfzIff+0=; b=m8qJz9Fw3+bj3YBwM w4k4WOGGMR7uUc+h3EGlnL5C6c3+C2MHKCrDNMbHPrTPC3DGtudy0AvDtkMyvfB9 1g6Qy771NZg/chYoOJy9fir3Q0igEcePC2OcjggaXlwzvDD2ayOz5nyOG2z9GVWW 7bHIICENUsCHnJpvcA8XY7WcGY= Received: (qmail 124336 invoked by alias); 21 Jan 2018 23:13:39 -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 124325 invoked by uid 89); 21 Jan 2018 23:13:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.8 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=UD:crash_unix_test.go, sk:testenv, sk:crash_u X-HELO: mail-io0-f169.google.com Received: from mail-io0-f169.google.com (HELO mail-io0-f169.google.com) (209.85.223.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 21 Jan 2018 23:13:37 +0000 Received: by mail-io0-f169.google.com with SMTP id p188so7585766ioe.12 for ; Sun, 21 Jan 2018 15:13:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=l+YPOQGathNpjKQK0xtUB3l5b6tB2NFZrp80ZC1r77s=; b=MqdI/cEiQFnUENEY9yz2qFsuNIzClet/+T73rwpsBwrF8Xb4rdtVjlZtfri3E38JpN NDMedjTcYcNdFqRZMA8NjQdQuNb4HF5y0ibF2P72Z5L89EQFLCh7RVhFjSOakE26eGrV bO8yEW9z2hTExIQf7xRxsBcVQvHPlhxeBqk7chFdy45FpLC1oN5Ve3OrCC7dlUHivRgw r3uvUSLYYyj0fz+j8IMEXhpvSGbI55sKxZJSVzowbQZp2R10jk806p7R8pv6eXDsDrl0 rcRdZ/R8s+4TWCPKZq6ahe99HqoJ/E24Wh/CsNDcRiybfWbskGNhZTNoalH5OmtkjUAN f9Nw== X-Gm-Message-State: AKwxytcduVBww5Xf0/1J7fVNfTMbtHEf0aO7cT7iqyIZ5+1zl6nX3dy5 5lYGTpXwzZn8DFDQ9wmGS8/Z9YVkM+JyndY2ukjqSg== X-Google-Smtp-Source: AH8x224PKcq/aXSNbHE2oqp3JL03VZuW0iiKWYEfE5pNv2455RAIr84+ZwDcXiO7g1XHZcvAaYdDpyRBS04XGMue2ug= X-Received: by 10.107.139.82 with SMTP id n79mr5671347iod.94.1516576415423; Sun, 21 Jan 2018 15:13:35 -0800 (PST) MIME-Version: 1.0 Received: by 10.2.181.171 with HTTP; Sun, 21 Jan 2018 15:13:34 -0800 (PST) From: Uros Bizjak Date: Mon, 22 Jan 2018 00:13:34 +0100 Message-ID: Subject: [PATCH, gotools]: Fix TestCrashDumpsAllThreads testcase failure To: "gcc-patches@gcc.gnu.org" Cc: Ian Taylor , gofrontend-dev@googlegroups.com Hello! The default "go build" compile options over-optimize the auxiliary executable, built in TestCrashDumpsAllThreads testcase (libgo/go/runtime/crash_unix_test.go). This over-optimization results in removal of the trivial summing loop and in the inlining of the main.loop function into main.$thunk0. The testcase expects backtrace that shows several instances of main.loop in the backtrace dump. When main.loop gets inlined into thunk, its name is not dumped anymore. The solution is to pass "-O0" to gccgo, which inhibits unwanted inlining. Patch was bootstrapped and regression tested on x86_64-linux-gnu and alphev68-linux-gnu, where for the later target the patch fixed the mentioned failure. Uros. Index: go/runtime/crash_unix_test.go =================================================================== --- go/runtime/crash_unix_test.go (revision 256858) +++ go/runtime/crash_unix_test.go (working copy) @@ -63,7 +63,7 @@ func TestCrashDumpsAllThreads(t *testing.T) { t.Fatalf("failed to create Go file: %v", err) } - cmd := exec.Command(testenv.GoToolPath(t), "build", "-o", "a.exe") + cmd := exec.Command(testenv.GoToolPath(t), "build", "-gccgoflags", "-O0", "-o", "a.exe") cmd.Dir = dir out, err := testenv.CleanCmdEnv(cmd).CombinedOutput() if err != nil {