/* Define builtin-in macros for all front ends that perform preprocessing
- Copyright (C) 2010-2013 Free Software Foundation, Inc.
+ Copyright (C) 2010-2021 Free Software Foundation, Inc.
This file is part of GCC.
#include "config.h"
#include "system.h"
#include "coretypes.h"
-#include "tm.h"
+#include "memmodel.h"
+#include "target.h"
#include "tree.h"
#include "version.h"
#include "flags.h"
-#include "cpp-id-data.h"
+#include "cpplib.h"
#include "cppbuiltin.h"
-#include "target.h"
/* Parse a BASEVER version string of the format "major.minor.patchlevel"
if (flag_sanitize & SANITIZE_ADDRESS)
cpp_define (pfile, "__SANITIZE_ADDRESS__");
+ if (flag_sanitize & SANITIZE_HWADDRESS)
+ cpp_define (pfile, "__SANITIZE_HWADDRESS__");
+
+ if (flag_sanitize & SANITIZE_THREAD)
+ cpp_define (pfile, "__SANITIZE_THREAD__");
+
if (optimize_size)
cpp_define (pfile, "__OPTIMIZE_SIZE__");
if (optimize)
cpp_define (pfile, "__FAST_MATH__");
if (flag_signaling_nans)
cpp_define (pfile, "__SUPPORT_SNAN__");
+ if (!flag_errno_math)
+ cpp_define (pfile, "__NO_MATH_ERRNO__");
cpp_define_formatted (pfile, "__FINITE_MATH_ONLY__=%d",
flag_finite_math_only);
define_builtin_macros_for_type_sizes (cpp_reader *pfile)
{
#define define_type_sizeof(NAME, TYPE) \
- cpp_define_formatted (pfile, NAME"="HOST_WIDE_INT_PRINT_DEC, \
- tree_low_cst (TYPE_SIZE_UNIT (TYPE), 1))
+ cpp_define_formatted (pfile, NAME"=" HOST_WIDE_INT_PRINT_DEC, \
+ tree_to_uhwi (TYPE_SIZE_UNIT (TYPE)))
define_type_sizeof ("__SIZEOF_INT__", integer_type_node);
define_type_sizeof ("__SIZEOF_LONG__", long_integer_type_node);
/* 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",
- POINTER_SIZE / BITS_PER_UNIT);
+ 1 << ceil_log2 ((POINTER_SIZE + BITS_PER_UNIT - 1) / BITS_PER_UNIT));
}