This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [4.5 C] C99-conforming excess precision (fix PR 323 for C)
On Wed, 5 Nov 2008, Ian Lance Taylor wrote:
> My personal preference would be for the option to become a sorry() for
> languages which do not support it, when used on a processor where it
> ought to make a difference.
I have applied these changes to that effect to c-4_5-branch. OK for 4.5?
Index: doc/invoke.texi
===================================================================
--- doc/invoke.texi (revision 141713)
+++ doc/invoke.texi (revision 141718)
@@ -6650,7 +6650,8 @@
conformance option such as @option{-std=c99} is used.
@opindex mfpmath
-This option has no effect for languages other than C, or if
+@option{-fexcess-precision=standard} is not implemented for languages
+other than C, and has no effect if
@option{-funsafe-math-optimizations} or @option{-ffast-math} is
specified. On the x86, it also has no effect if @option{-mfpmath=sse}
or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
Index: java/ChangeLog.c45
===================================================================
--- java/ChangeLog.c45 (revision 141713)
+++ java/ChangeLog.c45 (revision 141718)
@@ -1,3 +1,14 @@
+2008-11-09 Joseph Myers <joseph@codesourcery.com>
+
+ * lang.c (java_post_options): Give an error for
+ -fexcess-precision=standard only for processors where the
+ option is significant.
+
+2008-11-09 Joseph Myers <joseph@codesourcery.com>
+
+ * lang.c (java_post_options): Give an error for
+ -fexcess-precision=standard.
+
2008-11-04 Joseph Myers <joseph@codesourcery.com>
PR rtl-optimization/323
Index: java/lang.c
===================================================================
--- java/lang.c (revision 141713)
+++ java/lang.c (revision 141718)
@@ -530,6 +530,9 @@
/* Excess precision other than "fast" requires front-end
support. */
+ if (flag_excess_precision_cmdline == EXCESS_PRECISION_STANDARD
+ && TARGET_FLT_EVAL_METHOD_NON_DEFAULT)
+ sorry ("-fexcess-precision=standard for Java");
flag_excess_precision_cmdline = EXCESS_PRECISION_FAST;
/* An absolute requirement: if we're not using indirect dispatch, we
Index: defaults.h
===================================================================
--- defaults.h (revision 141713)
+++ defaults.h (revision 141718)
@@ -688,8 +688,11 @@
#define FLOAT_WORDS_BIG_ENDIAN WORDS_BIG_ENDIAN
#endif
-#ifndef TARGET_FLT_EVAL_METHOD
+#ifdef TARGET_FLT_EVAL_METHOD
+#define TARGET_FLT_EVAL_METHOD_NON_DEFAULT 1
+#else
#define TARGET_FLT_EVAL_METHOD 0
+#define TARGET_FLT_EVAL_METHOD_NON_DEFAULT 0
#endif
#ifndef TARGET_DEC_EVAL_METHOD
Index: ada/ChangeLog.c45
===================================================================
--- ada/ChangeLog.c45 (revision 141713)
+++ ada/ChangeLog.c45 (revision 141718)
@@ -1,3 +1,14 @@
+2008-11-09 Joseph Myers <joseph@codesourcery.com>
+
+ * gcc-interface/misc.c (gnat_post_options): Give an error for
+ -fexcess-precision=standard only for processors where the option
+ is significant.
+
+2008-11-09 Joseph Myers <joseph@codesourcery.com>
+
+ * gcc-interface/misc.c (gnat_post_options): Give an error for
+ -fexcess-precision=standard.
+
2008-11-04 Joseph Myers <joseph@codesourcery.com>
PR rtl-optimization/323
Index: ada/gcc-interface/misc.c
===================================================================
--- ada/gcc-interface/misc.c (revision 141713)
+++ ada/gcc-interface/misc.c (revision 141718)
@@ -339,6 +339,9 @@
{
/* Excess precision other than "fast" requires front-end
support. */
+ if (flag_excess_precision_cmdline == EXCESS_PRECISION_STANDARD
+ && TARGET_FLT_EVAL_METHOD_NON_DEFAULT)
+ sorry ("-fexcess-precision=standard for Ada");
flag_excess_precision_cmdline = EXCESS_PRECISION_FAST;
/* ??? The warning machinery is outsmarted by Ada. */
Index: fortran/ChangeLog.c45
===================================================================
--- fortran/ChangeLog.c45 (revision 141713)
+++ fortran/ChangeLog.c45 (revision 141718)
@@ -1,3 +1,14 @@
+2008-11-09 Joseph Myers <joseph@codesourcery.com>
+
+ * options.c (gfc_post_options): Give an error for
+ -fexcess-precision=standard only for processors where the
+ option is significant.
+
+2008-11-09 Joseph Myers <joseph@codesourcery.com>
+
+ * options.c (gfc_post_options): Give an error for
+ -fexcess-precision=standard.
+
2008-11-04 Joseph Myers <joseph@codesourcery.com>
PR rtl-optimization/323
Index: fortran/options.c
===================================================================
--- fortran/options.c (revision 141713)
+++ fortran/options.c (revision 141718)
@@ -32,6 +32,8 @@
#include "gfortran.h"
#include "target.h"
#include "cpp.h"
+#include "toplev.h"
+#include "tm.h"
gfc_option_t gfc_option;
@@ -229,6 +231,9 @@
/* Excess precision other than "fast" requires front-end
support. */
+ if (flag_excess_precision_cmdline == EXCESS_PRECISION_STANDARD
+ && TARGET_FLT_EVAL_METHOD_NON_DEFAULT)
+ sorry ("-fexcess-precision=standard for Fortran");
flag_excess_precision_cmdline = EXCESS_PRECISION_FAST;
/* Issue an error if -fwhole-program was used. */
Index: ChangeLog.c45
===================================================================
--- ChangeLog.c45 (revision 141713)
+++ ChangeLog.c45 (revision 141718)
@@ -1,5 +1,22 @@
2008-11-09 Joseph Myers <joseph@codesourcery.com>
+ * c-opts.c (c_common_post_options): Give an error for
+ -fexcess-precision=standard for C++ only for processors where the
+ option is significant.
+ * defaults.h (TARGET_FLT_EVAL_METHOD_NON_DEFAULT): Define.
+
+2008-11-09 Joseph Myers <joseph@codesourcery.com>
+
+ * doc/invoke.texi (-fexcess-precision=): Update documentation for
+ non-C languages.
+
+2008-11-09 Joseph Myers <joseph@codesourcery.com>
+
+ * c-opts.c (c_common_post_options): Give an error for
+ -fexcess-precision=standard for C++.
+
+2008-11-09 Joseph Myers <joseph@codesourcery.com>
+
* c-tree.h (in_late_binary_op): Declare.
* c-typeck.c (in_late_binary_op): New.
(note_integer_operands): Create overflowed INTEGER_CST if possible
Index: c-opts.c
===================================================================
--- c-opts.c (revision 141713)
+++ c-opts.c (revision 141718)
@@ -1020,7 +1020,12 @@
/* Excess precision other than "fast" requires front-end
support. */
if (c_dialect_cxx ())
- flag_excess_precision_cmdline = EXCESS_PRECISION_FAST;
+ {
+ if (flag_excess_precision_cmdline == EXCESS_PRECISION_STANDARD
+ && TARGET_FLT_EVAL_METHOD_NON_DEFAULT)
+ sorry ("-fexcess-precision=standard for C++");
+ flag_excess_precision_cmdline = EXCESS_PRECISION_FAST;
+ }
else if (flag_excess_precision_cmdline == EXCESS_PRECISION_DEFAULT)
flag_excess_precision_cmdline = (flag_iso
? EXCESS_PRECISION_STANDARD
--
Joseph S. Myers
joseph@codesourcery.com