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