From patchwork Sat Mar 18 05:48:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Wilson X-Patchwork-Id: 95442 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp85005qgd; Fri, 17 Mar 2017 22:51:25 -0700 (PDT) X-Received: by 10.99.163.72 with SMTP id v8mr9400476pgn.115.1489816285481; Fri, 17 Mar 2017 22:51:25 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id h5si5525658plk.137.2017.03.17.22.51.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Mar 2017 22:51:25 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-450266-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-450266-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-450266-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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:content-type; q= dns; s=default; b=bg5bszavPzR4HGGw7Dl91ttJ2ozKdH7uo6olPV9AJB0R9j 3n6hr2g0vA0f9ljCDjz/DkutwE585afZVxkazi7ZwPf6mzecE8cpfKwA1NshZOpA epX67+zFSA5Ny0qFU73lwI4Eiy1hO+awBXeWMfaOHUv3sTteisieERsVg8z2o= 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:content-type; s= default; bh=0O4JtsRbuHsIJ+qFZFNg0I5NtIE=; b=rMAxHpPCvfURSBLCkk1p pTdFSX7//Sl9CDw7PNvdgfwdJ1LksGokmT9FfL9dyiXKj0o03qcZQYPbu4XBxC8F ZcNYwjo3QKqwVOHPwAq0VNwEskEZQCZc8d3qkpIjPHGh+wotxDaXOtkWkx/ged3k 0OgN154dheuaOy/L2DDcIyI= Received: (qmail 82081 invoked by alias); 18 Mar 2017 05:49:14 -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 81596 invoked by uid 89); 18 Mar 2017 05:48:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=H*c:sk:94eb2c1, U*jim.wilson, jimwilsonlinaroorg, jim.wilson@linaro.org X-HELO: mail-lf0-f47.google.com Received: from mail-lf0-f47.google.com (HELO mail-lf0-f47.google.com) (209.85.215.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 18 Mar 2017 05:48:55 +0000 Received: by mail-lf0-f47.google.com with SMTP id y193so39953293lfd.3 for ; Fri, 17 Mar 2017 22:48:56 -0700 (PDT) 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; bh=VUh5erPzVjswQZ263nv9u30UKDbAOCTK6j3N7xJaawQ=; b=s3aWg5LW4oQG6RtnOXdPrlcmGbsfDoRqsWZzlnsmqOoPCSA3sHF1EnRfP7gccbpenA SUzLVR+WzneHDWGfg0D19KOYSKlg+98NC7REFO8XU0KAJvWvV1szfl+874eLQW+j1r+D BRK3PP7GfGAXn6Nx9Tki+qE0/lPPx9d8OV+/StgV1ZyLk7Az8YDEjnD3lhNTJjTCJNBr 9k4NJa8tEY3YBT90UZbayHMZ1GZi1ik753iXe7w9Vl0tRgjHKU7oJR5YG7r995XCLMQP /fvh1pJjQeEBbKP21TTDl+vrFnULb95w4Rmd9VEcPxGRVYXAUoKM/+W/sKkU8NavxTvG RjRA== X-Gm-Message-State: AFeK/H2U3x3JwI9YUJpSKdR5Z5kRhdzuN8ihMG0bewaI3RlbDEHsdd9Tgh1snHn0Ell9GfktTGgwY4D9YX9f9h0o X-Received: by 10.46.15.25 with SMTP id 25mr5588088ljp.64.1489816133702; Fri, 17 Mar 2017 22:48:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.162.145 with HTTP; Fri, 17 Mar 2017 22:48:52 -0700 (PDT) From: Jim Wilson Date: Fri, 17 Mar 2017 22:48:52 -0700 Message-ID: Subject: [PATCH] fix aarch64/combine bootstrap miscompare To: "gcc-patches@gcc.gnu.org" We get different code for libcpp/line-map.o in stage2 and stage3, because stage2 is compiled with -gtoggle and stage3 is not. Bernd's recent combine patch is being confused by debug insns. This is fixed by changing a prev_nonnote_insn call to a prev_nonnote_nondebug_insn call. There is also a redundant test for i1 that I've removed. This was tested with an x86_64 bootstrap, aarch64 bootstrap, and aarch64 make check. I noticed 3 new failures as a result of the combine patch that need to be looked at FAIL: gcc.target/aarch64/tst_5.c scan-assembler tst\t(x|w)[0-9]+,[ \t]*255 FAIL: gcc.target/aarch64/tst_5.c scan-assembler tst\t(x|w)[0-9]+,[ \t]*65535 FAIL: gcc.target/aarch64/tst_6.c scan-assembler tst\t(x|w)[0-9]+,[ \t]*65535 The testcases are expecting a tst instruction to be generated, but we get and/cmp instead. I think this is because combinations with a hard reg are now disabled in some cases. I haven't had a chance to look at this in detail yet. The patch was preapproved by Jeff and has been checked in. Jim 2017-03-17 Jim Wilson * combine.c (try_combine): Delete redundant i1 test. Call prev_nonnote_nondebug_insn instead of prev_nonnote_insn. Index: gcc/combine.c =================================================================== --- gcc/combine.c (revision 246226) +++ gcc/combine.c (working copy) @@ -2806,9 +2806,8 @@ bitmap_set_bit (links_regset, ll->regno); FOR_EACH_LOG_LINK (ll, i2) bitmap_set_bit (links_regset, ll->regno); - if (i1) - FOR_EACH_LOG_LINK (ll, i1) - bitmap_set_bit (links_regset, ll->regno); + FOR_EACH_LOG_LINK (ll, i1) + bitmap_set_bit (links_regset, ll->regno); if (i0) FOR_EACH_LOG_LINK (ll, i0) bitmap_set_bit (links_regset, ll->regno); @@ -4142,7 +4141,7 @@ multi-word registers. Later, when fixing up LOG_LINKS, we deal with the case where a pseudo use moved. */ if (!bitmap_empty_p (new_regs_in_i2) - && prev_nonnote_insn (i3) != i2 + && prev_nonnote_nondebug_insn (i3) != i2 && bitmap_first_set_bit (new_regs_in_i2) < FIRST_PSEUDO_REGISTER) { undo_all ();