OSDN Git Service

PR c++/46245
[pf3gnuchains/gcc-fork.git] / gcc / cppbuiltin.c
index 7ac4071..cf7d2ff 100644 (file)
@@ -25,9 +25,9 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree.h"
 #include "version.h"
 #include "flags.h"
-#include "toplev.h"
 #include "cpp-id-data.h"
 #include "cppbuiltin.h"
+#include "target.h"
 
 
 /* Parse a BASEVER version string of the format "major.minor.patchlevel"
@@ -90,7 +90,7 @@ define_builtin_macros_for_compilation_flags (cpp_reader *pfile)
   if (optimize)
     cpp_define (pfile, "__OPTIMIZE__");
 
-  if (fast_math_flags_set_p ())
+  if (fast_math_flags_set_p (&global_options))
     cpp_define (pfile, "__FAST_MATH__");
   if (flag_signaling_nans)
     cpp_define (pfile, "__SUPPORT_SNAN__");
@@ -151,11 +151,17 @@ define_builtin_macros_for_type_sizes (cpp_reader *pfile)
   else
     {
       /* Assert that we're only dealing with the PDP11 case.  */
-      gcc_assert (!BYTES_BIG_ENDIAN && WORDS_BIG_ENDIAN);
+      gcc_assert (!BYTES_BIG_ENDIAN);
+      gcc_assert (WORDS_BIG_ENDIAN);
 
       cpp_define (pfile, "__BYTE_ORDER__=__ORDER_PDP_ENDIAN__");
     }
 
+  cpp_define_formatted (pfile, "__FLOAT_WORD_ORDER__=%s",
+                        (targetm.float_words_big_endian ()
+                         ? "__ORDER_BIG_ENDIAN__"
+                         : "__ORDER_LITTLE_ENDIAN__"));
+
   /* ptr_type_node can't be used here since ptr_mode is only set when
      toplev calls backend_init which is not done with -E switch.  */
   cpp_define_formatted (pfile, "__SIZEOF_POINTER__=%d",