From patchwork Tue Sep 29 21:49:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Law X-Patchwork-Id: 524030 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 977BC14016A for ; Wed, 30 Sep 2015 07:49:32 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=Kg6ixNUc; 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:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=J1JfowvBBrYFCcbHONN0+oHpKbRYSH1FbnBtRn65yScb3Drn4+ SKj3krXzkNKtVbVKlQbpHtyd5pEpAH/VlObk/a/PDI+WzZbYIiUS4OUDYwoXAqBW lK7grZ9+4YBNDTE77jBj1wDJHRNUPnRdTUAeRMyAGz1gOjbw9+zjfmte8= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=cbGvocBBUAtgCCXTFZjKVftWc+Y=; b=Kg6ixNUcnfuoPjzlLkyz H/MoTS/pI+VdIrU+SCjoMqXKKNNvWDHMLGoBANn/CfsgQQBlTFXoVduJ3u7vns48 LbddHbk3jJJJN2gS1CwOoPP5bOHKsKH544uf5v+dEIq5qD0RCTkHDtx7plii8UEo G+U1OkVFd60jUVAtES7TeG4= Received: (qmail 96979 invoked by alias); 29 Sep 2015 21:49:25 -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 96968 invoked by uid 89); 29 Sep 2015 21:49: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, SPF_HELO_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 29 Sep 2015 21:49:24 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id F38314DAFE for ; Tue, 29 Sep 2015 21:49:22 +0000 (UTC) Received: from localhost.localdomain (ovpn-113-59.phx2.redhat.com [10.3.113.59]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t8TLnMaN032420 for ; Tue, 29 Sep 2015 17:49:22 -0400 To: gcc-patches From: Jeff Law Subject: [RFA][PATCH] Fix building cr16-elf with trunk compiler Message-ID: <560B0762.9090902@redhat.com> Date: Tue, 29 Sep 2015 15:49:22 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 X-IsSubscribed: yes This code from builtins.c: /* If we don't need too much alignment, we'll have been guaranteed proper alignment by get_trampoline_type. */ if (TRAMPOLINE_ALIGNMENT <= STACK_BOUNDARY) return tramp; It's entirely conceivable that TRAMPOLINE_ALIGNMENT will be the same as STACK_BOUNDARY. And if they are, then -Wtautological-compare will complain bitterly. This affects the cr16 port and possibly others (I've had this fix in my tree while running the config-all.mk builds). Given the real possibility that those two objects are the same and thus the complaint from -Wtautological-compare, it seems best to simply disable -Wtautological-compare for this function. Bootstrapped and regression tested on x86_64-linux-gnu and also used to successfully build cr16-elf cross compilers from config-all.mk. OK for the trunk? Other alternatives would be to obfuscate the appropriate macros in the cr16 port. That seemed wrong in this case to me. Jeff * builtins.c (round_trampoline_addr): Turn off -Wtautological-compare when compiling this function. diff --git a/gcc/builtins.c b/gcc/builtins.c index 1592810..e4ed470 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -4830,6 +4830,11 @@ expand_builtin___clear_cache (tree exp) return const0_rtx; } +#if GCC_VERSION >= 6000 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wtautological-compare" +#endif + /* Given a trampoline address, make sure it satisfies TRAMPOLINE_ALIGNMENT. */ static rtx @@ -4854,6 +4859,9 @@ round_trampoline_addr (rtx tramp) return tramp; } +#if GCC_VERSION >= 6000 +#pragma GCC diagnostic pop +#endif static rtx expand_builtin_init_trampoline (tree exp, bool onstack)