From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16176 invoked by alias); 1 Feb 2014 11:52:25 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 16163 invoked by uid 89); 1 Feb 2014 11:52:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wg0-f47.google.com Received: from mail-wg0-f47.google.com (HELO mail-wg0-f47.google.com) (74.125.82.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sat, 01 Feb 2014 11:52:22 +0000 Received: by mail-wg0-f47.google.com with SMTP id m15so10035724wgh.2 for ; Sat, 01 Feb 2014 03:52:19 -0800 (PST) X-Received: by 10.180.7.227 with SMTP id m3mr2229993wia.59.1391255539815; Sat, 01 Feb 2014 03:52:19 -0800 (PST) Received: from localhost ([2.28.234.162]) by mx.google.com with ESMTPSA id u6sm6119483wif.6.2014.02.01.03.52.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 01 Feb 2014 03:52:19 -0800 (PST) From: Richard Sandiford To: "Steve Ellcey " Mail-Followup-To: "Steve Ellcey " ,, , rdsandiford@googlemail.com Cc: , Subject: Re: MIPS GCC test failure: gcc.dg/tree-ssa/ssa-dom-thread-4.c References: <5c24a8c6-2af6-4098-a64c-4760751aeef0@BAMAIL02.ba.imgtec.org> Date: Sat, 01 Feb 2014 11:52:00 -0000 In-Reply-To: <5c24a8c6-2af6-4098-a64c-4760751aeef0@BAMAIL02.ba.imgtec.org> (Steve Ellcey's message of "Fri, 31 Jan 2014 16:31:13 -0800") Message-ID: <87iosz9hjh.fsf@talisman.default> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2014-02/txt/msg00002.txt.bz2 "Steve Ellcey " writes: > I was looking at the test failure of gcc.dg/tree-ssa/ssa-dom-thread-4.c > on MIPS. The failure is in the scan of how many jumps are threaded > which has changed from 6 to 4 on MIPS. Yeah, I'd been leaving this one until I could devote a bit of time to it. > I tracked down the change to this patch: > > 2013-11-19 Jeff Law > > * tree-ssa-threadedge.c (thread_across_edge): After threading > through a joiner, allow threading a normal block requiring > duplication. > > * tree-ssa-threadupdate.c (thread_block_1): Improve code to detect > jump threading requests that would muck up the loop structures. > > * tree-ssa-threadupdate.c: Fix trailing whitespace. > * tree-ssa-threadupdate.h: Likewise. Thanks for tracking down the patch that changed it. > Now my initial thought is to just change the mips scan to look for > 4 'Threaded' lines instead of 6 and be done with it, but the test has > a long explanation of why 6 is the right answer on MIPS and I don't know > what to do with this. Even after looking at the new and old dom1 dump > files I can't really explain why 4 is the right number now instead of 6. It's because the earlier vrp1 pass is now doing the !kill_elt -> continuation point threading (the third item from the list). vrp1 runs before the header of the inner while loop is duplicated, so here the transformation only happens once rather than twice. vrp1 is now also duplicating the b_elt-testing block in: if (b_elt && kill_elt && kill_elt->indx == b_elt->indx ... for the "kill_elt->indx >= b_elt->indx" branch of the while loop so that it can thread out the known-true kill_elt test. I.e., if the while loop stops on "kill_elt->indx >= b_elt->indx", the if statement will test: if (b_elt && kill_elt->indx == b_elt->indx ... But it's still down to dom1 to recognise that the b_elt test itself is also redundant in this case, so the fourth item on the list still holds. I applied this patch to update the MIPS results after checking that it also works for arc-elf and avr-elf. Thanks, Richard gcc/testsuite/ * gcc.dg/tree-ssa/ssa-dom-thread-4.c: Adjust expected MIPS output. Index: gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-4.c =================================================================== --- gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-4.c 2014-02-01 11:37:12.793270725 +0000 +++ gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-4.c 2014-02-01 11:37:13.021272556 +0000 @@ -66,7 +66,7 @@ bitmap_ior_and_compl (bitmap dst, const_ "a_elt || b_elt" and "b_elt && kill_elt" into two conditions each, rather than using "(var1 != 0) op (var2 != 0)". Also, as on other targets, we duplicate the header of the inner "while" loop. There are then - 6 threading opportunities: + 4 threading opportunities: 1x "!a_elt && b_elt" in the outer "while" loop -> the start of the inner "while" loop, @@ -74,16 +74,13 @@ bitmap_ior_and_compl (bitmap dst, const_ 1x "!b_elt" in the first condition -> the outer "while" loop's continuation point, skipping the known-false "b_elt" in the second condition. - 2x "!kill_elt" in the inner "while" loop - -> the outer "while" loop's continuation point, - skipping the known-false "b_elt && kill_elt" in the second condition - 2x "kill_elt->indx < b_elt->indx" in the first "while" loop + 2x "kill_elt->indx >= b_elt->indx" in the first "while" loop -> "kill_elt->indx == b_elt->indx" in the second condition, skipping the known-true "b_elt && kill_elt" in the second condition. */ /* Likewise for arc. */ /* For avr, BRANCH_COST is by default 0, so the default LOGICAL_OP_NON_SHORT_CIRCUIT definition also computes as 0. */ -/* { dg-final { scan-tree-dump-times "Threaded" 6 "dom1" { target mips*-*-* avr-*-* arc*-*-* } } } */ +/* { dg-final { scan-tree-dump-times "Threaded" 4 "dom1" { target mips*-*-* avr-*-* arc*-*-* } } } */ /* { dg-final { cleanup-tree-dump "dom1" } } */