aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2020-10-27 09:51:56 +0100
committerJan Hubicka <jh@suse.cz>2020-10-27 09:51:56 +0100
commit0365b9e4af29dc65c4d1634ca3444362d2ad0422 (patch)
tree7ad21a03f9475aa26f7cf0e9e816a34afcfb887b /gcc
parente94de06fd6077438539b2d7c18eb8fcb113bd9b6 (diff)
downloadgcc-0365b9e4af29dc65c4d1634ca3444362d2ad0422.zip
gcc-0365b9e4af29dc65c4d1634ca3444362d2ad0422.tar.gz
gcc-0365b9e4af29dc65c4d1634ca3444362d2ad0422.tar.bz2
Fix fnspec of math builtins
* builtin-attrs.def (STRERRNOC): New macro. (STRERRNOP): New macro. (ATTR_ERRNOCONST_NOTHROW_LEAF_LIST): New attr list. (ATTR_ERRNOPURE_NOTHROW_LEAF_LIST): New attr list. * builtins.def (ATTR_MATHFN_ERRNO): Use ATTR_ERRNOCONST_NOTHROW_LEAF_LIST. (ATTR_MATHFN_FPROUNDING_ERRNO): Use ATTR_ERRNOCONST_NOTHROW_LEAF_LIST or ATTR_ERRNOPURE_NOTHROW_LEAF_LIST.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/builtin-attrs.def6
-rw-r--r--gcc/builtins.def5
2 files changed, 9 insertions, 2 deletions
diff --git a/gcc/builtin-attrs.def b/gcc/builtin-attrs.def
index 778bc8a..0875724 100644
--- a/gcc/builtin-attrs.def
+++ b/gcc/builtin-attrs.def
@@ -67,6 +67,8 @@ DEF_ATTR_FOR_INT (6)
DEF_ATTR_TREE_LIST (ATTR_LIST_##ENUM, ATTR_NULL, \
ATTR_##ENUM, ATTR_NULL)
DEF_ATTR_FOR_STRING (STR1, "1 ")
+DEF_ATTR_FOR_STRING (STRERRNOC, ".C")
+DEF_ATTR_FOR_STRING (STRERRNOP, ".P")
#undef DEF_ATTR_FOR_STRING
/* Construct a tree for a list of two integers. */
@@ -136,6 +138,10 @@ DEF_ATTR_TREE_LIST (ATTR_CONST_NOTHROW_LIST, ATTR_CONST, \
ATTR_NULL, ATTR_NOTHROW_LIST)
DEF_ATTR_TREE_LIST (ATTR_CONST_NOTHROW_LEAF_LIST, ATTR_CONST, \
ATTR_NULL, ATTR_NOTHROW_LEAF_LIST)
+DEF_ATTR_TREE_LIST (ATTR_ERRNOCONST_NOTHROW_LEAF_LIST, ATTR_FNSPEC,\
+ ATTR_LIST_STRERRNOC, ATTR_NOTHROW_LEAF_LIST)
+DEF_ATTR_TREE_LIST (ATTR_ERRNOPURE_NOTHROW_LEAF_LIST, ATTR_FNSPEC,\
+ ATTR_LIST_STRERRNOP, ATTR_NOTHROW_LEAF_LIST)
DEF_ATTR_TREE_LIST (ATTR_PURE_NOTHROW_LIST, ATTR_PURE, \
ATTR_NULL, ATTR_NOTHROW_LIST)
DEF_ATTR_TREE_LIST (ATTR_PURE_NOTHROW_LEAF_LIST, ATTR_PURE, \
diff --git a/gcc/builtins.def b/gcc/builtins.def
index 61aff89..68f2da6 100644
--- a/gcc/builtins.def
+++ b/gcc/builtins.def
@@ -254,7 +254,7 @@ along with GCC; see the file COPYING3. If not see
`errno'. If !flag_errno_math they are instead "const". */
#undef ATTR_MATHFN_ERRNO
#define ATTR_MATHFN_ERRNO (flag_errno_math ? \
- ATTR_NOTHROW_LEAF_LIST : ATTR_CONST_NOTHROW_LEAF_LIST)
+ ATTR_ERRNOCONST_NOTHROW_LEAF_LIST : ATTR_CONST_NOTHROW_LEAF_LIST)
/* Define an attribute list for math functions that are normally
"const" but if flag_rounding_math is set they are instead "pure".
@@ -271,7 +271,8 @@ along with GCC; see the file COPYING3. If not see
"const" depending on whether we care about FP rounding. */
#undef ATTR_MATHFN_FPROUNDING_ERRNO
#define ATTR_MATHFN_FPROUNDING_ERRNO (flag_errno_math ? \
- ATTR_NOTHROW_LEAF_LIST : ATTR_MATHFN_FPROUNDING)
+ (flag_rounding_math ? ATTR_ERRNOPURE_NOTHROW_LEAF_LIST \
+ : ATTR_ERRNOCONST_NOTHROW_LEAF_LIST) : ATTR_MATHFN_FPROUNDING)
/* Define an attribute list for math functions that need to mind FP
rounding, but because they store into memory they are never "const"