aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2012-12-13 00:05:23 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2012-12-13 00:05:23 +0100
commitbc77608b97abcc4bb3171f08a71e34ae342e9f8d (patch)
tree8c2fea9ca79fe3b04ca6ae2eeb6453359c825d09 /gcc
parent46cda8a06cf04acf404ab1cdf365993ca3fe4d16 (diff)
downloadgcc-bc77608b97abcc4bb3171f08a71e34ae342e9f8d.zip
gcc-bc77608b97abcc4bb3171f08a71e34ae342e9f8d.tar.gz
gcc-bc77608b97abcc4bb3171f08a71e34ae342e9f8d.tar.bz2
re PR sanitizer/55508 (many test cases fail using -fsanitize=address with internal compiler error: in expand_call_tm)
PR sanitizer/55508 * builtin-attrs.def (ATTR_TMPURE_NOTHROW_LEAF_LIST, ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST): New. * asan.c (ATTR_TMPURE_NOTHROW_LEAF_LIST, ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST): Define. * sanitizer.def: Make __asan_report_* and __asan_handle_no_return builtins tm pure. From-SVN: r194459
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/asan.c5
-rw-r--r--gcc/builtin-attrs.def5
-rw-r--r--gcc/sanitizer.def22
4 files changed, 31 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 48aae88..5d5dbe0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+2012-12-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR sanitizer/55508
+ * builtin-attrs.def (ATTR_TMPURE_NOTHROW_LEAF_LIST,
+ ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST): New.
+ * asan.c (ATTR_TMPURE_NOTHROW_LEAF_LIST,
+ ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST): Define.
+ * sanitizer.def: Make __asan_report_* and __asan_handle_no_return
+ builtins tm pure.
+
2012-12-12 Steve Ellcey <sellcey@mips.com>
* config/mips/mips.c (mips_option_override): Set
diff --git a/gcc/asan.c b/gcc/asan.c
index 45b0dbd..40af45d 100644
--- a/gcc/asan.c
+++ b/gcc/asan.c
@@ -1611,8 +1611,13 @@ initialize_sanitizer_builtins (void)
#define BT_FN_VOID_VPTR_I16_INT BT_FN_VOID_VPTR_IX_INT[4]
#undef ATTR_NOTHROW_LEAF_LIST
#define ATTR_NOTHROW_LEAF_LIST ECF_NOTHROW | ECF_LEAF
+#undef ATTR_TMPURE_NOTHROW_LEAF_LIST
+#define ATTR_TMPURE_NOTHROW_LEAF_LIST ECF_TM_PURE | ATTR_NOTHROW_LEAF_LIST
#undef ATTR_NORETURN_NOTHROW_LEAF_LIST
#define ATTR_NORETURN_NOTHROW_LEAF_LIST ECF_NORETURN | ATTR_NOTHROW_LEAF_LIST
+#undef ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST
+#define ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST \
+ ECF_TM_PURE | ATTR_NORETURN_NOTHROW_LEAF_LIST
#undef DEF_SANITIZER_BUILTIN
#define DEF_SANITIZER_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
decl = add_builtin_function ("__builtin_" NAME, TYPE, ENUM, \
diff --git a/gcc/builtin-attrs.def b/gcc/builtin-attrs.def
index 545b6fd..364e721 100644
--- a/gcc/builtin-attrs.def
+++ b/gcc/builtin-attrs.def
@@ -263,6 +263,11 @@ DEF_ATTR_TREE_LIST (ATTR_TMPURE_MALLOC_NOTHROW_LIST,
DEF_ATTR_TREE_LIST (ATTR_TMPURE_NOTHROW_LIST,
ATTR_TM_TMPURE, ATTR_NULL, ATTR_NOTHROW_LIST)
+DEF_ATTR_TREE_LIST (ATTR_TMPURE_NOTHROW_LEAF_LIST,
+ ATTR_TM_TMPURE, ATTR_NULL, ATTR_NOTHROW_LEAF_LIST)
+DEF_ATTR_TREE_LIST (ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST,
+ ATTR_TM_TMPURE, ATTR_NULL, ATTR_NORETURN_NOTHROW_LEAF_LIST)
+
/* Construct a tree for a format_arg attribute. */
#define DEF_FORMAT_ARG_ATTRIBUTE(FA) \
DEF_ATTR_TREE_LIST (ATTR_FORMAT_ARG_##FA, ATTR_FORMAT_ARG, \
diff --git a/gcc/sanitizer.def b/gcc/sanitizer.def
index fee8f13..987e212 100644
--- a/gcc/sanitizer.def
+++ b/gcc/sanitizer.def
@@ -32,25 +32,25 @@ DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_INIT, "__asan_init",
/* Do not reorder the BUILT_IN_ASAN_REPORT* builtins, e.g. cfgcleanup.c
relies on this order. */
DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_LOAD1, "__asan_report_load1",
- BT_FN_VOID_PTR, ATTR_NORETURN_NOTHROW_LEAF_LIST)
+ BT_FN_VOID_PTR, ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST)
DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_LOAD2, "__asan_report_load2",
- BT_FN_VOID_PTR, ATTR_NORETURN_NOTHROW_LEAF_LIST)
+ BT_FN_VOID_PTR, ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST)
DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_LOAD4, "__asan_report_load4",
- BT_FN_VOID_PTR, ATTR_NORETURN_NOTHROW_LEAF_LIST)
+ BT_FN_VOID_PTR, ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST)
DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_LOAD8, "__asan_report_load8",
- BT_FN_VOID_PTR, ATTR_NORETURN_NOTHROW_LEAF_LIST)
+ BT_FN_VOID_PTR, ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST)
DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_LOAD16, "__asan_report_load16",
- BT_FN_VOID_PTR, ATTR_NORETURN_NOTHROW_LEAF_LIST)
+ BT_FN_VOID_PTR, ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST)
DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_STORE1, "__asan_report_store1",
- BT_FN_VOID_PTR, ATTR_NORETURN_NOTHROW_LEAF_LIST)
+ BT_FN_VOID_PTR, ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST)
DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_STORE2, "__asan_report_store2",
- BT_FN_VOID_PTR, ATTR_NORETURN_NOTHROW_LEAF_LIST)
+ BT_FN_VOID_PTR, ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST)
DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_STORE4, "__asan_report_store4",
- BT_FN_VOID_PTR, ATTR_NORETURN_NOTHROW_LEAF_LIST)
+ BT_FN_VOID_PTR, ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST)
DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_STORE8, "__asan_report_store8",
- BT_FN_VOID_PTR, ATTR_NORETURN_NOTHROW_LEAF_LIST)
+ BT_FN_VOID_PTR, ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST)
DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_STORE16, "__asan_report_store16",
- BT_FN_VOID_PTR, ATTR_NORETURN_NOTHROW_LEAF_LIST)
+ BT_FN_VOID_PTR, ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST)
DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REGISTER_GLOBALS,
"__asan_register_globals",
BT_FN_VOID_PTR_PTRMODE, ATTR_NOTHROW_LEAF_LIST)
@@ -59,7 +59,7 @@ DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_UNREGISTER_GLOBALS,
BT_FN_VOID_PTR_PTRMODE, ATTR_NOTHROW_LEAF_LIST)
DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_HANDLE_NO_RETURN,
"__asan_handle_no_return",
- BT_FN_VOID, ATTR_NOTHROW_LEAF_LIST)
+ BT_FN_VOID, ATTR_TMPURE_NOTHROW_LEAF_LIST)
/* Thread Sanitizer */
DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_INIT, "__tsan_init",