From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 66095 invoked by alias); 21 Oct 2015 00:03:15 -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 66081 invoked by uid 89); 21 Oct 2015 00:03:14 -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,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 X-HELO: arjuna.pair.com Received: from arjuna.pair.com (HELO arjuna.pair.com) (209.68.5.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 21 Oct 2015 00:03:13 +0000 Received: by arjuna.pair.com (Postfix, from userid 3006) id 9A9818A237; Tue, 20 Oct 2015 20:03:09 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by arjuna.pair.com (Postfix) with ESMTP id 8C61C8A1E9; Tue, 20 Oct 2015 20:03:09 -0400 (EDT) Date: Wed, 21 Oct 2015 00:05:00 -0000 From: Hans-Peter Nilsson To: Jeff Law cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Don't allow FSM threader to create irreducible loops unless it eliminates a multi-way branch In-Reply-To: <56251919.5050104@redhat.com> Message-ID: References: <56251919.5050104@redhat.com> User-Agent: Alpine 2.02 (BSF 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-IsSubscribed: yes X-SW-Source: 2015-10/txt/msg02003.txt.bz2 On Mon, 19 Oct 2015, Jeff Law wrote: > If I hack up GCC's old jump threader to avoid threading across backedges and > instead let the FSM threader handle that case, then we end up with cases where > the FSM threader creates irreducible loops with marginal benefit. > > This can be seen in ssa-dom-thread-2{d,e,f}.c. > > We've long avoided such threads in the old jump threader. We generally want > to avoid them in the FSM threader as well. The only case where we're going to > allow them is when we're able to eliminate a multi-way branch from the loop. > > Bootstrapped and regression tested on x86_64-linux-gnu. Also tested the above > mentioned testcases with my hacked up compiler. > > Installed on the trunk. Please do *not* backport this, it causes unreachable-jump-table-entry issues for cris-elf, breaking build in newlib. Although this *is* a manifestation of undue reliance on assembler broken-dot-word support for this target, I can imagine similar issues with branches stretched beyond optimal limit for other targets. I have no idea whether there's an actual bug related to the patch or something "just waiting to happen" and 16-bit-offsets just too close to the limits. Brief inspection of the generated assembly-code is, well, "inconclusive". Also, I'm travelling at the moment. brgds, H-P