From patchwork Wed Jun 20 21:15:44 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Ellcey X-Patchwork-Id: 166152 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]) by ozlabs.org (Postfix) with SMTP id CA92DB6FB4 for ; Thu, 21 Jun 2012 07:16:15 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1340831776; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:From:Date:To:CC:Subject:User-Agent:MIME-Version: Content-Type:Content-Transfer-Encoding:Message-ID:Mailing-List: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:Sender:Delivered-To; bh=eMq+ip/6O+Y6D0OOcF1WjSEmvfc=; b=EBlwZbdjnXw/wV/M8Q9HVF3J6586xWGWFtqFru8c/pzDzWg+RZ33cphdthshDK 351mvdeOOAvkOCwtAQIiFi8likJFNHUI1JdO9MZBogMN455kilA1V8+zIgxOvirz W/aNWEpRlztwEuKEzU4JMl/lZcKYSg/gg7gY1NgmQGjI4= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:From:Date:To:CC:Subject:User-Agent:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID:X-EMS-Proccessed:X-EMS-STAMP:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=LsxvdrSl4uoFQdVWWr0GZ2Xd+8rck1Vzvt5ecx8ST7B7+GdXKbggIlBnBS4rAy WaIf4jbhThhotKlNY5bHCYq6cPyBziwlvhmSjY6fCfCzZH4aJufV0Pz3vhau6H98 PZyojJVPnRx9sotH0Dcx94uPLK+GxRrZU1ZbraXIpVhP0=; Received: (qmail 21000 invoked by alias); 20 Jun 2012 21:16:08 -0000 Received: (qmail 20989 invoked by uid 22791); 20 Jun 2012 21:16:07 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from dns1.mips.com (HELO dns1.mips.com) (12.201.5.69) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 20 Jun 2012 21:15:54 +0000 Received: from exchdb01.mips.com (exchhub01.mips.com [192.168.36.84]) by dns1.mips.com (8.13.8/8.13.8) with ESMTP id q5KLFook032569; Wed, 20 Jun 2012 14:15:50 -0700 Received: from ubuntu-sellcey.mips.com (192.168.65.53) by exchhub01.mips.com (192.168.36.84) with Microsoft SMTP Server id 14.1.270.1; Wed, 20 Jun 2012 14:15:44 -0700 Received: by ubuntu-sellcey.mips.com (sSMTP sendmail emulation); Wed, 20 Jun 2012 14:15:44 -0700 From: "Steve Ellcey " Date: Wed, 20 Jun 2012 14:15:44 -0700 To: CC: Subject: [Patch, mips] Fix warning when using --with-synci User-Agent: Heirloom mailx 12.4 7/29/08 MIME-Version: 1.0 Message-ID: <1eecf735-7c65-4330-8941-0edc3ce91c1d@EXCHHUB01.MIPS.com> X-EMS-Proccessed: 6LP3oGfGVdcdb8o1aBnt6w== X-EMS-STAMP: UVP3rIBEfmnVrwiIlBUupQ== 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 This patch addresses the problem of building GCC for mips with the '--with-synci' configure option. If you do that and then compile a program with GCC and specify an architecture that does not support synci (such as the -mips32 option), GCC will issue a warning that synci is not supported. This results in many problems including an inability to build a multilib version of GCC that includes -mips32. This patch changes the gcc driver to pass --msynci-if-supported to cc1 instead of -msynci so that cc1 will only turn on synci if it is supported on the architecture being compiled for and will leave it off (and not generate a warning) if it is not supported on that architecture. If the user specifically uses -msynci, they still get the warning. Tested on mips-linux-gnu, OK for checkin? Steve Ellcey sellcey@mips.com 2012-06-20 Steve Ellcey * config.gcc: Set with_synci to synci-if-supported instead if synci. * config/mips/mips.c (mips_option_override): Check TARGET_SYNCI_IF_SUPPORTED and update target_flags. * config/mips/mips.opt (msynci-if-supported): New. diff --git a/gcc/config.gcc b/gcc/config.gcc index f2b0936..58ee3e9 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -3281,7 +3281,7 @@ case "${target}" in case ${with_synci} in yes) - with_synci=synci + with_synci=synci-if-supported ;; "" | no) # No is the default. diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 5bcb7a8..f17d39b 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -16172,6 +16172,9 @@ mips_option_override (void) : !TARGET_BRANCHLIKELY)) sorry ("%qs requires branch-likely instructions", "-mfix-r10000"); + if (TARGET_SYNCI_IF_SUPPORTED && !TARGET_SYNCI && ISA_HAS_SYNCI) + target_flags |= MASK_SYNCI; + if (TARGET_SYNCI && !ISA_HAS_SYNCI) { warning (0, "the %qs architecture does not support the synci " diff --git a/gcc/config/mips/mips.opt b/gcc/config/mips/mips.opt index e3294a7..1dbce65 100644 --- a/gcc/config/mips/mips.opt +++ b/gcc/config/mips/mips.opt @@ -338,6 +338,9 @@ msynci Target Report Mask(SYNCI) Use synci instruction to invalidate i-cache +msynci-if-supported +Target Mask(SYNCI_IF_SUPPORTED) RejectNegative Undocumented + mtune= Target RejectNegative Joined Var(mips_tune_option) ToLower Enum(mips_arch_opt_value) -mtune=PROCESSOR Optimize the output for PROCESSOR