This is the mail archive of the
mailing list for the GCC project.
Shouldn't unsafe-math-optimizations (re-)enable fp-contract=fast?
- From: "Ian Bolton" <ian dot bolton at arm dot com>
- To: <gcc at gcc dot gnu dot org>
- Date: Thu, 6 Mar 2014 16:45:34 -0000
- Subject: Shouldn't unsafe-math-optimizations (re-)enable fp-contract=fast?
- Authentication-results: sourceware.org; auth=none
I see in common.opt that fp-contract=fast is the default for GCC.
But then it gets disabled in c-family/c-opts.c if you are using ISO C
(e.g. with -std=c99).
But surely if you have also specified -funsafe-math-optimizations then
it should flip it back onto fast?
I see in gcc/opts.c that a few other flags are triggered based on
-funsafe-math-optimizations but not -ffp-contract=fast.
I think this is a bug and could lead to less optimal code than people
would like if they want c99 compliance for reason A but also unsafe
math for reason B.
What do you think?