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: 740580 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vlWY31l48z9s03 for ; Sat, 18 Mar 2017 16:51:18 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="UJlvtsX3"; dkim-atps=neutral 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=VOBDTe3zn7mXbyMncBOnJmz4f1iBUkvXJR8Z3DBYak1sPR X/EZfjWE1Srw2cyHsYDukxjxsShUaMfEaIt7Le3dayKLu99gGkrPFTv0tE9p2fxG Y11Jl9CcMa5GRbIqocJPiDOhBQrnBOqKK8dT9ZNGnqwHtjMeZy+6f/fMdmhqM= 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=UJlvtsX3jqJ+DHul+ay5 fVtB8dEKU7pgrZuBgGT9yUq8R+7dxuMg0gnz438UgdrE1gxXpcfz/WVkBMk1inbJ sTBTclOOlSWP9pYemr5ifM7k/5ZdcE2zvUm0D5tW7LAXBuhk82ZoJhvwztTa+DNT c5/8xLZuxZ3OUCxhekgC5IM= 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 ();