public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Sandra Loosemore <sandra@codesourcery.com>
To: Sebastian Huber <sebastian.huber@embedded-brains.de>,
	<gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH 1/2] nios2: Add -mcustom-fpu-cfg=fph2
Date: Fri, 15 Jan 2021 15:08:51 -0700	[thread overview]
Message-ID: <10d89495-0039-44c5-d119-8d9d6bcff121@codesourcery.com> (raw)
In-Reply-To: <50a972c4-97df-a0f4-ca9e-d6b21952bb9e@embedded-brains.de>

On 1/15/21 2:27 PM, Sebastian Huber wrote:
> Hello Sandra,
> 
> On 15/01/2021 20:12, Sandra Loosemore wrote:
>>>
>>> The following instructions supported by this component are not enabled
>>> by this option:
>>>
>>> * -mcustom-fmins
>>> * -mcustom-fmaxs
>>> * -mcustom-round
>>>
>>> The reason is that these instructions are only in effect in combination
>>> with other options. If they are not set, then a build error occurs in
>>> libatomic since -Werror is used for building this library:
>>>
>>> cc1: error: switch '-mcustom-fmins' has no effect unless 
>>> '-ffinite-math-only' is specified [-Werror]
>>> cc1: error: switch '-mcustom-fmaxs' has no effect unless 
>>> '-ffinite-math-only' is specified [-Werror]
>>> cc1: error: switch '-mcustom-round' has no effect unless 
>>> '-fno-math-errno' is specified [-Werror]
>>>
>>
>> Seems like it would be better to have a separate switch to disable 
>> these warnings, or perhaps remove them entirely, as I'm sure there are 
>> other custom instructions that are not used unless -ffinite-math-only, 
>> -fno-math-errno, or -ffast-math are also specified (e.g., I see an 
>> issue in our internal tracker about fsqrts) and we don't consistently 
>> warn about those.  So I think the warnings are of dubious value. Maybe 
>> the existing -Wdisabled-optimization flag could be used here to 
>> control the warnings we're already checking for? 
> 
> thanks for having a look at it. It would be good to control the warning 
> via an option not enabled by -Wall or remove the warnings. The 
> -Wdisabled-optimization not used in gcc/config/*:
> 
> grep -r 'warning (OPT_Wdisabled' gcc/
> gcc/tree-ssa-loop-prefetch.c:     warning (OPT_Wdisabled_optimization,
> gcc/gcse.c:      warning (OPT_Wdisabled_optimization,
> gcc/gcse.c:      warning (OPT_Wdisabled_optimization,
> 
> The warning description doesn't really fit from my point of view.
> 
> Maybe use -Wextra which is already used by avr (not really a prime target):
> 
> grep -r 'warning (OPT_Wextra' gcc/config
> gcc/config/avr/avr.c:          warning (OPT_Wextra, "rounding to %d bits 
> has no effect for "

Hmmm, -Wextra seems too generic.  At this point, I think the easiest 
thing would just be to remove the warnings.  I'm pretty sure other 
backends don't warn if you specify some CPU variant that includes 
instructions that aren't used by GCC unless you also specify -ffast-math 
or whatever, and that's basically what's going on here.

-Sandra



      reply	other threads:[~2021-01-15 22:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-14 19:16 Sebastian Huber
2021-01-14 19:16 ` [PATCH 2/2] RTEMS: Add -mcustom-fpu-cfg=fph2 multilib Sebastian Huber
2021-01-15 19:13   ` Sandra Loosemore
2021-01-15 19:12 ` [PATCH 1/2] nios2: Add -mcustom-fpu-cfg=fph2 Sandra Loosemore
2021-01-15 21:27   ` Sebastian Huber
2021-01-15 22:08     ` Sandra Loosemore [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=10d89495-0039-44c5-d119-8d9d6bcff121@codesourcery.com \
    --to=sandra@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=sebastian.huber@embedded-brains.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).