From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6563 invoked by alias); 30 Jul 2012 19:38:45 -0000 Received: (qmail 6555 invoked by uid 22791); 30 Jul 2012 19:38:44 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_40,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-wi0-f179.google.com (HELO mail-wi0-f179.google.com) (209.85.212.179) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 30 Jul 2012 19:38:32 +0000 Received: by wibhq4 with SMTP id hq4so1787505wib.8 for ; Mon, 30 Jul 2012 12:38:30 -0700 (PDT) Received: by 10.180.83.66 with SMTP id o2mr424527wiy.14.1343677110661; Mon, 30 Jul 2012 12:38:30 -0700 (PDT) Received: from localhost ([2.26.188.227]) by mx.google.com with ESMTPS id ef5sm26451494wib.3.2012.07.30.12.38.20 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 30 Jul 2012 12:38:28 -0700 (PDT) From: Richard Sandiford To: Sandra Loosemore Mail-Followup-To: Sandra Loosemore ,, rdsandiford@googlemail.com Cc: Subject: Re: [PATCH, MIPS] -mno-float odds and ends References: <5016BE96.9000106@codesourcery.com> Date: Mon, 30 Jul 2012 19:39:00 -0000 In-Reply-To: <5016BE96.9000106@codesourcery.com> (Sandra Loosemore's message of "Mon, 30 Jul 2012 11:04:22 -0600") Message-ID: <874nop2g5h.fsf@talisman.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 X-SW-Source: 2012-07/txt/msg01511.txt.bz2 Sandra Loosemore writes: > The MIPS back end has an option -mno-float that is supported by > bare-metal configs using the SDE library. However, this option is not > properly documented in the manual, and MIPS_ARCH_FLOAT_SPEC doesn't know > about it as one of the explicit floating-point configuration changes > that should override architecture defaults. This patch addresses both > problems. OK to commit? OK, you're touching a sore spot here, but... > +@item -mno-float > +@opindex mno-float > +Prevents the use of all floating-point operations. This option is presently > +supported only by some bare-metal MIPS configurations. ...unfortunately, it doesn't prevent the use floating-point operations. That's why it's such a bad option. The only difference from the compiler proper's point of view between -msoft-float and -mno-float is that they define different preprocessor macros. The onus is instead on the programmer to avoid writing anything that might tempt the compiler into using floating-point operations. If the user gets it wrong, they get (at best) a link-time error rather than a compile-time error. I think we should document it that way. E.g. something like: @item -mno-float @opindex mno-float Equivalent to @option{-msoft-float}, but asserts that the user is trying to avoid all floating-point operations. This option is presently supported only by some bare-metal MIPS configurations, where it selects a special set of libraries that lack all floating-point support (including, for example, the floating-point @code{printf} formats). If code compiled with @code{-mno-float} accidentally contains floating-point operations, it is likely to suffer a link-time or run-time failure. but you're better at the wordsmithing than I am. Perhaps we should document the __mips_no_float preprocessor macro too, since that's how things like printf() know that they don't need the floating-point stuff. The mips.h part is OK though, thanks. Feel free to apply it separately if that's more convenient than keeping the patch together. Richard